【发布时间】:2021-03-30 00:12:37
【问题描述】:
我有这个错误
Expected coroutine function, not 'Command'
该代码用于帮助命令
async def help(ctx, command_name=None):
reactions = ["⬅️", "➡️"]
embed = discord.Embed(title=" Help Command",description="Show The Help Command", color=0x87CEEB)
embed.set_author(name="Gaming Bot", icon_url="https://upload.wikimedia.org/wikipedia/commons/c/c7/Loading_2.gif")
embed.add_field(name="Member Text Commands", value="Help\nId\nInfo\nPing\nPoll", inline=True)
embed.add_field(name="Member Voice Commands", value="Join\nDisconnect", inline=True)
embed.add_field(name="Admin Commands", value="Prefix\nMute\nBan\nUnban\nClear\nKick", inline=False)
oh_cool = await ctx.send(embed=embed)
await oh_cool.add_reaction(reactions[0])
await oh_cool.add_reaction(reactions[1])
【问题讨论】:
-
能否请您添加完整回溯?
-
Traceback (most recent call last): File "main.py", line 151, in <module> async def help1(ctx, command_name=None): File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 506, in decorator return Loop(func, **kwargs) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 76, in __init__ raise TypeError('Expected coroutine function, not {0.__name__!r}.'.format(type(self.coro))) TypeError: Expected coroutine function, not 'Command' -
编辑您的问题,不要在 cmets 中发布错误
标签: python discord.py