A module for creating and using application commands on discord.
Project description
dpy-appcommands
Support
If you want any support then join my discord server
Installation
To install this module, run
pip install -U dpy-appcommands
Usage
For a headstart, here's an example
but if you want to view full
documentation on it then click here
import appcommands
from discord.ext import commands
bot = appcommands.Bot(command_prefix=commands.when_mentioned_or('?'))
class Blep(SlashCommand):
def __init__(self):
super().__init__(
name="blep",
description = "Some blep description",
)
async def callback(self, ctx: InteractionContext, pleb: str = None):
await ctx.reply(f"why {pleb}", ephemeral=True)
# or
@bot.slashcommand(name="test", description="test")
async def test(ctx):
await ctx.send("tested")
# or
@bot.slashcommand(name="test2", description="test")
async def test(ctx):
await ctx.respond(f"tested {ctx.author}")
@bot.event
async def on_ready():
print(f'Logged on as {bot.user} (ID: {bot.user.id})')
await bot.add_app_command(Blep())
bot.run("TOKEN")
Screenshots
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dpy-appcommands-2.0.4.tar.gz
(17.4 kB
view hashes)
Built Distributions
Close
Hashes for dpy_appcommands-2.0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b09f7ffe4dfcafb9522df13f745bc02810e0521a5924935a524daea057458d5 |
|
MD5 | 9b754475e77aab7e99947a399de3a254 |
|
BLAKE2b-256 | 28f1e45865586317c1a2b199da55ee27ffdd35cad81966c8ead4c2f0b310b808 |
Close
Hashes for dpy_appcommands-2.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9adef278c6ffdafc7a07b8e6960ccf5560792247159f7cb6638c72f9b63b1dc7 |
|
MD5 | 0c7fd65b69cfe420cd8bebd59ac52fe7 |
|
BLAKE2b-256 | 065b97e00ea0d8ea442e639ddc7642c8699421ed1e39ec8c3fd6a38d212dd1cb |