DontSniffSugar
DontSniffSugar

Reputation: 1

Cannot use commands and events together in discord bot

Source, (Forgive my possible spaghetti code, I am not that good) I am trying to add commands on this old code that I made a while back and the commands through events work just fine but the actual proper commands do not work.

Please could I get some tips or help?

Here is the source https://repl.it/@DontSniffSugar/DiscordBot#main.py

Upvotes: 0

Views: 131

Answers (1)

Łukasz Kwieciński
Łukasz Kwieciński

Reputation: 15698

The issue in your code is that you didn't process the commands. When overwriting the default on_message event you also have to process them.

@client.event
async def on_message(message):
    # ...
    await client.process_commands(message)

Also a small note for the future, don't post links to your code, the code should be in the question itself. Also you should enable some intents, if you don't what that is and how to enable them, take a look at the introduction

Reference:

Upvotes: 1

Related Questions