[英]Discord.py ctx commands not responding
我的 ctx 命令都不起作用。 這里我舉個例子。 當我說p!test
我希望它打印hi
並說test
,但它沒有響應。 有人可以幫忙嗎?
@client.command()
async def test(ctx):
print('hi')
await ctx.channel.send('test')
如果您使用on_message
事件,則必須在事件的最后一行“處理命令”。 否則,您的命令將不起作用。
@client.event
async def on_message(message):
...
await client.process_commands(message)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.