Skip to main content

description

Project description

installing

pip install interactions.cooldowns

cooldowns

This is a quickstart and api docs for this module

Quickstart

import interactions
import interactions.ext.cooldowns
guild_id = 0
token = ""
#create bot
bot = interactions.Client(token=token)
#create function on cooldown fail
async def error(ctx, t):
  await ctx.send(f"Wait {t} secconds")
#command
@bot.command(
    name="test",
    description="This is the first command I made!",
    scope=guild_id,
)
#define cooldown function and time of cooldown
@cooldowns.cooldown(error, 10, "user")
async def my_first_command(ctx: interactions.CommandContext):
  await ctx.send("Hi there!")
#start bot
bot.start()

api

cooldown.cooldown()

error

error function, leave None for placeholder

time

time of cooldown

type

guild

user

channel

_clean_timers

cleans all timers

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

interactions-cooldowns-1.0.5.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

interactions_cooldowns-1.0.5-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

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