You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

function-cooldowns

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-cooldowns

A simplistic decorator based approach to rate limiting function calls.

2.2.0
pipPyPI
Maintainers
1

Function Cooldowns

A simplistic take on functional cooldowns.

pip install function-cooldowns

Example usage

A simplistic example, read more on the docs!

import cooldowns

...

@bot.slash_command(
    description="Ping command",
)
@cooldowns.cooldown(1, 15, bucket=cooldowns.SlashBucket.author)
async def ping(interaction: nextcord.Interaction):
    await interaction.response.send_message("Pong!")

Find more examples here.

For documentation, please see here.

This implements the leaky bucket algorithm

Support

Want realtime help? Join the discord here.

Funding

Want a feature added quickly? Want me to help build your software using this?

Sponsor me here

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts