Skip to content
Advertisement

Why is my cooldown sending even when there is no cooldown? discord.py

So I am attempting to create a cooldown for one of my commands.

(The command)

JavaScript

My issue is that the cooldown text is sent right after the message despite the command not being sent twice.

(The command error event)

JavaScript

Extra information you may need:

(Opens json files for use)

JavaScript

(Closes json files and saves them)

JavaScript

(Imports)

JavaScript

Example of the issue:

User’s Current Balance

Coins: 689

This command is on cooldown, you can use it in 5.0 seconds.

If you need any more information about the program please let me know!

Advertisement

Answer

So it turns out the issue was not in the code listed.

on_message() really likes to break things and there is more information on the FAQ (https://discordpy.readthedocs.io/en/latest/faq.html#why-does-on-message-make-my-commands-stop-working)

Advertisement