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
Built Distribution
Close
Hashes for interactions-cooldowns-1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b89e5c0db1f62da4d813812378cb130e15d52a6fbb006a72835bca1354a7a64c |
|
MD5 | f89bc23342c58151155b1b0d0aed163a |
|
BLAKE2b-256 | 725ca168d6b6caeb2dd3455f0921d450226da156871b3a91463133cb539de086 |
Close
Hashes for interactions_cooldowns-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee9b7dc97128407afcf6adfd70c8c2fbef518b9ce5265abc6328732fd42dae52 |
|
MD5 | 506dc5bd7d33acd8a90a9ebbb484cfe2 |
|
BLAKE2b-256 | 950e0863fa020e2f11a885a68285d9f2ef91ce34bb01f3b9e2a1757fbd7f2b53 |