디코봇 생성기(1)

‍박소연·2023년 3월 13일

챗봇

목록 보기
1/5

디코로 동아리 관리하기 빡세다,,,
자동화의 필요성을 느끼기도 했고 챗봇에 급 흥미가 생겨서 호다닥 챗봇 만들기 시작!

def main():
	#봇이 채팅을 읽을 때, !로 시작하는 모든 메세지를 명령어로 인식
    prefix = '!'
    #서버 멤버의 정보나, 서버 멤버 리스트 불러오도록 허용
    intents = discord.Intents.all()

	#Bot 객체 생성
    client = commands.Bot(command_prefix=prefix, intents = intents)
    
    with open('token.txt', 'r') as f:
        token = f.read()

    client.run(token)

if __name__ == '__main__':
    main()

에러 발생
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.


해결과정

Priveilged Gateway Intents 어찌고 여기 전부 다 허용해줬더니 해결

아놔,,,강의에서는 위에 2개만 허용했는데 ㅡ,ㅡ,,
pip 버전도 오래되고 지금은 안되는 이런 에러보니 오래된 강의인거 같아서 다른 강의로 갈아타기로 했다


내 bot 온라인으로 등장!

0개의 댓글