【发布时间】:2017-11-25 17:53:54
【问题描述】:
我正在使用 discord.py 版本 0.16.8。我的客户也是:client = discord.Client()。
在写await client.send_message(All the usual code is in here) 时,我在等待时收到一条错误消息:
“类 'Message' 没有定义 'await',因此不能在其实例上使用 'await' 运算符”。
当我尝试在 Discord 中运行我的 Bot 并尝试我的命令之一时,它不起作用,并且没有消息弹出。这是我的命令代码:
@client.event
async def on_message(message):
if message.content == '..roll':
await client.send_message(message.channel, str(randint(1, 6)))
我们将不胜感激,谢谢!
【问题讨论】:
标签: python async-await discord.py