2017-10-08 160 views
0

当我检查的事件像on_message(message),每一个命令停止工作活动/命令不工作

如果我删除的情况下,一切都恢复正常。

使用此代码,命令不起作用。

@bot.event 
async def on_ready(): 
    print("Connected.")  

@bot.event 
async def on_message(message): 
    print("test") 

@bot.command(pass_context=True) 
async def hello(ctx): 
    print("test") 

删除事件部分时,该命令正常工作。

+0

在定义ON_MESSAGE你忘了下划线明确调用命令。 – Rob

+0

我刚写了一段类似的代码,无论如何它没有解决我的问题 – Francesco

回答

0

书面here,您需要在覆盖ON_MESSAGE

@bot.event 
async def on_message(message): 
    # do some extra stuff here 

    await bot.process_commands(message)