*급합니다 discord.py 오류의 해결법을 알려주세요

22.10.29 18:55 작성 조회수 229

0

현재 디스코드 봇을 처음 만들고 있습니다

지금 현재 vscode에서 파이썬 3.8.10 버전과 discord.py 2.0.1을 쓰고있습니다

vscode에서 실행을 돌리면

bot = commands.Bot(command_prefix="!")

이 코드에서

예외가 발생했습니다. TypeError

  •  

init() missing 1 required keyword-only argument: 'intents'

File "C:\Users\steve\Desktop\test4\test4.py", line 6, in <module> bot = commands.Bot(command_prefix="!")

라고 오류가 뜨네요

이런 경우 해결방법을 아시는 분 계실까요?

전체 코드입니다.

import discord
from discord.ext import commands


token = 'MTAyMjAyNDkzNzE4MTAyMDIwMQ.GHUJEl.F97peSnol7JiFMetVsqnIdaZELl7IZxIE7SXoo'
bot = commands.Bot(command_prefix="!")


@bot.event
async def on_ready():
    await bot.change_presence(status=discord.Status.online, activity=discord.Game("반갑습니다 :D"))
    print("Bot is ready")


@bot.command()
async def hello(ctx):
    await ctx.send("Hello world")

bot.run(token)

답변 1

답변을 작성해보세요.

0

kjysteve님의 프로필

kjysteve

질문자

2022.10.29

해결했습니다