【发布时间】:2021-08-18 20:34:36
【问题描述】:
@client.command()
async def inspire(context):
wait_msg = await context.send("Finding a quote for ya...")
await wait_msg.edit(content=inspire())
Error : RuntimeWarning: coroutine 'Command.__call__' was never awaited
await wait_msg.edit(content=inspire())
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
此方法适用于 @client.event ,但我在 @client.command 上遇到运行时错误,我是机器人开发新手,所以谁能告诉我如何解决这个问题。
【问题讨论】:
-
content=inspire()需要改成你要设置的实际内容 -
Joshua Nixon,
inspire()函数返回一个字符串,那不行吗? -
它不返回字符串。激发是你的命令功能。确保函数具有唯一的名称
标签: python discord discord.py