Skip to main content

A simplistic decorator based approach to rate limiting function calls.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

function-cooldowns-2.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

function_cooldowns-2.0.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file function-cooldowns-2.0.1.tar.gz.

File metadata

  • Download URL: function-cooldowns-2.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for function-cooldowns-2.0.1.tar.gz
Algorithm Hash digest
SHA256 9e396bda4876708161ec4907ba6008c833d20694f0bd8837e22d9118dd99d22a
MD5 c6216c9e07b1c3a366aa4e63332681f3
BLAKE2b-256 33507ccc9da5d5cb9d437e4a862ddf531eedd5550c0ae7ac391a1cbc0f36b93b

See more details on using hashes here.

File details

Details for the file function_cooldowns-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for function_cooldowns-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cad0e9f15f5cc879fa7193e64a6344e1b9481e237ca94e28adf9691b3da9e5ee
MD5 d4c496029432baadb60f4d743160e21b
BLAKE2b-256 de7fe826039f69d9c0e9d6af001fe7eb6f00b05348db264364cc58576ffbaa87

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page