I'm trying to make a discord.py bot have a command which a user can use only once an hour. I want the bot to send a message "The command is on cooldown" when someone uses the command more than once an hour. This is the code for the command:
bot = discord.Client()
@bot.event
@commands.cooldown(1, 3600, commands.BucketType.user)
async def on_message(message):
await message.channel.send("hello")
bot.run("xxxxxxxxxxxx")
How do I achieve that?
source https://stackoverflow.com/questions/72956258/how-to-make-discord-py-bot-to-send-a-specific-message-if-the-command-is-on-coold
Comments
Post a Comment