【发布时间】:2022-11-17 22:53:55
【问题描述】:
我试图制作一个不和谐的机器人,我使用了这段代码:
import discord
from discord.ext import commands
bot=commands.Bot(command_prefix='/')
@bot.event
async def on_ready():
print("Black_knight is up again")\`
并弹出此错误:
line 6, in \<module\>
bot=commands.Bot(command_prefix='/')
TypeError: __init__() missing 1 required keyword-only argument: 'intents'
另外,我试着把
intents = discord.Intents.default()
intents.message_content = True
在bot.commands之前,但仍然得到同样的错误。
【问题讨论】:
标签: python discord discord.py python-3.8