Invite command, CD on roll

This commit is contained in:
2023-05-04 21:21:45 +02:00
parent e9a8535e1c
commit 198057304f
3 changed files with 31 additions and 1 deletions
+7
View File
@@ -11,6 +11,7 @@ class Roll(commands.Cog):
print("roll.py is ready")
@commands.command()
@commands.cooldown(1, 600, commands.BucketType.user)
async def roll(self, ctx):
rolled = random.randint(1,100)
rating = ""
@@ -38,6 +39,12 @@ class Roll(commands.Cog):
await ctx.send(message)
@roll.error
async def on_command_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
time = round(error.retry_after/60)
message = f"This command is on cooldown, the cooldown ends in {time} minutes"
await ctx.send(message)
async def setup(client):
await client.add_cog(Roll(client))