Skip to content
Advertisement

Commands not working after adding message.delete() function to certain keywords

JavaScript

The commands that used the bot prefix to run stopped working after adding a client event to delete messages containing certain keywords. I recently started coding so all help would be very appreciated. The discord.py documentation is kinda complicated so i cannot find what i am looking for. For more details please ask me in the comments.

Advertisement

Answer

You have to use this:

JavaScript

Without this, none of your commands will work.


So, your event will look like this:

JavaScript

Also, you forgot to add @client.event. Without it, the on_message() function won’t act as a listener.

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