inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

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

해결된 질문

471

kjysteve

작성한 질문수 1

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

해결했습니다

강의 수강 후 포트폴리오 준비 방향에 대해 조언 부탁드립니다.

2

35

1

쿠버네티스 어나더 클래스-Sprint 1, 2 강의 관련 질문이있습니다.

1

34

1

갑자기 stock_prediction은 어디서 발생한건가요?

1

49

2

FRED API

1

44

1