Skip to content
Advertisement

Discord.py client.run and bot.run in one code

Not sure that I need to use the both runs at the same time, but:

JavaScript

If you run this code and comment the “bot.run(‘ToKeN’)”, the first part of the code will work (def on_message), however the command ‘/help’ will not work. If you change it (comment ‘client.run(‘ToKeN’)’), the command ‘/help’ will work, but def on_message not.

What are the possible solutions? Thanks.

Advertisement

Answer

The .runs block each other and prevent from running. You shouldn’t be using a client and a bot anyway. Use one commands.Bot instead. It subclasses a Client and it should be able to do everything you can do with the client.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement