inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

디스코드 봇을 만드는데 에러가 나요

1088

승빈
0

import discord, asyncio

client = discord.Client()

@client.event
async def on_ready():
    print("이 문장은 Python의 내장 함수를 출력하는 터미널에서 실행됩니다\n지금 보이는 것 처럼 말이죠")
    await client.change_presence(status=discord.Status.online, activity=discord.Game("봇의 상태매세지"))

@client.event
async def on_message(message):
    if message.content == "테스트":
        await message.channel.send ("{} | {}, Hello".format(message.author, message.author.mention))
        await message.author.send ("{} | {}, User, Hello".format(message.author, message.author.mention))

client.run('내 디스코드 토큰')

저 토큰자리에 제 봇 토큰을 넣고 돌렸는데 3번째 줄에서 자꾸 이런 에러가 나네요

검색해봐도 모르겠어요

TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'

답변 1

0

데브경수

안녕하세요 지나가던 사람인데요 잘은모르지만

 intents = discord.Intents.default()
 # intents.typing = False
 # intents.presences = False


 client = discord.Client(intents=intents)

요렇게 해보면 어떨까요?