Fix ctc2 error with typo, add error message for message on cooldown

This commit is contained in:
Zeva Rose 2021-07-22 09:11:35 -06:00
parent 3b2653962c
commit 48237b74d7
2 changed files with 5 additions and 1 deletions

View file

@ -32,7 +32,7 @@ class CTCCog(commands.Cog):
description="Guess a password for https://completethecodetwo.cards", description="Guess a password for https://completethecodetwo.cards",
guild_ids=guild_ids, guild_ids=guild_ids,
) )
@commands.cooldown(1, 2, commands.BucketType.uer) @commands.cooldown(1, 2, commands.BucketType.user)
async def _pw(self, ctx, guess: str): async def _pw(self, ctx, guess: str):
guessed = self.db.ctc2.guesses.find_one({"guess": guess}) guessed = self.db.ctc2.guesses.find_one({"guess": guess})
if guessed: if guessed:

View file

@ -11,6 +11,8 @@ class ErrorHandlerCog(commands.Cog):
await ctx.send("I'm afraid I can't let you do that.") await ctx.send("I'm afraid I can't let you do that.")
elif isinstance(error, commands.errors.CommandNotFound): elif isinstance(error, commands.errors.CommandNotFound):
return return
elif isinstance(error, commands.errors.CommandOnCooldown):
await ctx.send("Please wait before trying again")
else: else:
await ctx.send(f"Error processing command:\n```{error}```") await ctx.send(f"Error processing command:\n```{error}```")
@ -22,6 +24,8 @@ class ErrorHandlerCog(commands.Cog):
await ctx.send("I'm afraid I can't let you do that.", hidden=True) await ctx.send("I'm afraid I can't let you do that.", hidden=True)
elif isinstance(error, commands.errors.CommandNotFound): elif isinstance(error, commands.errors.CommandNotFound):
return return
elif isinstance(error, commands.errors.CommandOnCooldown):
await ctx.send("Please wait before trying again")
else: else:
await ctx.send( await ctx.send(
f"Error processing command:\n```{error}```", hidden=True f"Error processing command:\n```{error}```", hidden=True