Implement Rate Limiting for AI primarily #19

Open
opened 2026-02-02 15:15:36 -05:00 by jared · 0 comments
Owner

from discord.ext import commands

@client.tree.command(name="expensive_operation")
@app_commands.checks.cooldown(1, 60.0, key=lambda i: i.user.id)
async def expensive_operation(interaction: discord.Interaction):
# Command logic
pass

from discord.ext import commands @client.tree.command(name="expensive_operation") @app_commands.checks.cooldown(1, 60.0, key=lambda i: i.user.id) async def expensive_operation(interaction: discord.Interaction): # Command logic pass
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/discordBot#19