Why does on_message stop commands from working?

后端 未结 1 1543
死守一世寂寞
死守一世寂寞 2020-11-22 05:56

Basically, everything appears to work fine and start up, but for some reason I can\'t call any of the commands. I\'ve been looking around for easily an hour now and

相关标签:
1条回答
  • 2020-11-22 06:11

    From the documentation:

    Overriding the default provided on_message forbids any extra commands from running. To fix this, add a bot.process_commands(message) line at the end of your on_message. For example:

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

    The default on_message contains a call to this coroutine, but when you override it with your own on_message, you need to call it yourself.

    0 讨论(0)
提交回复
热议问题