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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interactions-cooldowns-1.0.5.tar.gz.
File metadata
- Download URL: interactions-cooldowns-1.0.5.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b89e5c0db1f62da4d813812378cb130e15d52a6fbb006a72835bca1354a7a64c
|
|
| MD5 |
f89bc23342c58151155b1b0d0aed163a
|
|
| BLAKE2b-256 |
725ca168d6b6caeb2dd3455f0921d450226da156871b3a91463133cb539de086
|
File details
Details for the file interactions_cooldowns-1.0.5-py3-none-any.whl.
File metadata
- Download URL: interactions_cooldowns-1.0.5-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9b7dc97128407afcf6adfd70c8c2fbef518b9ce5265abc6328732fd42dae52
|
|
| MD5 |
506dc5bd7d33acd8a90a9ebbb484cfe2
|
|
| BLAKE2b-256 |
950e0863fa020e2f11a885a68285d9f2ef91ce34bb01f3b9e2a1757fbd7f2b53
|