Search code examples
pythonpython-3.xdiscorddiscord.py

Commands in discord.py rewrite


How would you make a command that only people with a certain role can use, has a 5 hour cooldown per user, and the command takes a line from a .txt file and dms that string to the user that ran the command, and deletes it from the .txt file?


Solution

  • Look in the API docs for discord.ext.commands.has_role() and discord.ext.commands.cooldown()
    Both can be used as decorators