rate limit

This commit is contained in:
Lanta 2025-10-03 09:03:31 +02:00
parent 8fdc97067a
commit a36425d798

View file

@ -369,6 +369,7 @@ async def dtch_help_command(ctx):
await ctx.send(embed=embed) await ctx.send(embed=embed)
@bot.command() @bot.command()
@commands.cooldown(1, 15, commands.BucketType.user)
async def ask(ctx, *, vraag: str): async def ask(ctx, *, vraag: str):
## CLAN MEMBERS ## CLAN MEMBERS
file_path = os.path.join("..", "config", "clanmembers.json") file_path = os.path.join("..", "config", "clanmembers.json")
@ -431,5 +432,11 @@ async def ask(ctx, *, vraag: str):
await ctx.send(f"{ctx.author.mention} {antwoord[:1900]}") await ctx.send(f"{ctx.author.mention} {antwoord[:1900]}")
except Exception as e: except Exception as e:
await ctx.send(f"{ctx.author.mention} Er ging iets mis: {e}") await ctx.send(f"{ctx.author.mention} Er ging iets mis: {e}")
@ask.error
async def ask_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
retry_after = int(error.retry_after + 0.999)
await ctx.reply(f"Rustig {ctx.author.display_name}, probeer het over {retry_after}s nog eens.")
else:
raise error
bot.run(token) bot.run(token)