0

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

  • don't forget to use `@client.command(pass_context=True)` instead of just `@client.command()`. Also be careful with how you name your variables, as you have two `clients` – Cristian Mar 11 '21 at 04:54
  • Does this answer your question? [Why does on\_message stop commands from working?](https://stackoverflow.com/questions/49331096/why-does-on-message-stop-commands-from-working) – 0rdinal Mar 11 '21 at 17:21

1 Answers1

1

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:

Łukasz Kwieciński
  • 14,992
  • 4
  • 21
  • 39