【发布时间】:2021-10-26 08:39:33
【问题描述】:
情况:
我正在尝试使用 pycord 制作一个简单的不和谐机器人,但每次运行代码时都会出现此错误:
Traceback (most recent call last):
File "main.py", line 3, in <module>
bot = discord.Bot()
AttributeError: module 'discord' has no attribute 'Bot'
代码:
import discord
bot = discord.Bot()
@bot.slash_command()
async def test(ctx):
await ctx.send('Success!')
bot.run('token')
我做了什么:
我已经检查过我是否安装了 pycord 以及我的令牌是否正确。
【问题讨论】: