How do I avoid exceeding Discord API rate limits in discord.py?

Viewed 2303

I'm making a Discord bot and I recently got a temporary API ban because I got rate limited. These bans are from calling the API too frequently, and I've tried putting cooldowns on the commands using-

@bot.command()
@commands.cooldown(1, 5, commands.BucketType.user)
async def ...

However, even if someone uses a command while it is on cooldown, it still counts as a request to the API.

Is there a way I could avoid this using discord.py?

1 Answers

make sure you dont have to many background commands or using api stuff like mass banning etc that could flag your account.

Related