Skip to main content

A discord.py slash commands extension

Project description

slash-ext

Yet another slash command lib made for discord.py, except this one intergrates will intergrate with discord.ext, thus making it a lot easier to use. Some resources are provided too, such as the INTERACTION_CREATE socket response. This is provided in the debug.json file. I do not mind sharing this token as its invalid.

Example:

import discord
from discord.ext import commands, slash
from discord.ext.slash.abc import SlashContext

bot = commands.Bot(command_prefix = "!", case_insensitive = True)
slashParent = slash.SlashBot(bot, "<bot token>", 770301542170361896) #<= Bot User ID

@bot.event
async def on_ready():
    print("Ready!")




@slashParent.slash_command(name = "rachel", description = "hola", guild_ids=[830418497837203457]) #make sure to not have names with spaces in them as discord will not create them.
async def dummy(ctx : SlashContext):
    embeds = [discord.Embed(title = "Hello World")]
    await ctx.send(content = "Hello World", embeds = embeds)
    await ctx.edit(content = "Hello Discord")

@bot.event
async def on_slash_recieve(payload): #=> event that is fired when a slash command is fired and it is found in the bot's cache
    print("RECEIEVED SLASH")
    print(payload)

bot.run("<bot token>")

We give you the option to pass in the bot token and bot user id because you cannot access the token and id before the bot is ready. If you have any questions, please DM me on Discord: moonie#6598

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

dpy-slash-ext-0.0.1a0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

dpy_slash_ext-0.0.1a0-py3-none-any.whl (5.2 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