All Projects → eunwoo1104 → Discord Py Slash Command

eunwoo1104 / Discord Py Slash Command

Licence: mit
A simple discord slash command handler for discord.py.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Discord Py Slash Command

Lenoxbot
🖥️ LenoxBot is a Discord bot that offers many cool new features to your Discord server!
Stars: ✭ 163 (-10.93%)
Mutual labels:  discord-api, discord
Discordrpcmaker
Cross-platform Discord Rich Presence Maker, WITH BUTTONS!
Stars: ✭ 165 (-9.84%)
Mutual labels:  discord-api, discord
Serenity
A Rust library for the Discord API.
Stars: ✭ 1,387 (+657.92%)
Mutual labels:  discord-api, discord
Discord Rich Presence Tool
A C++/Qt program that lets you fill in your own custom Discord Rich Presence information for games and activities away from the PC.
Stars: ✭ 91 (-50.27%)
Mutual labels:  discord-api, discord
Discord Haskell
Haskell library for writing Discord bots
Stars: ✭ 129 (-29.51%)
Mutual labels:  discord-api, discord
Music Bot
Simple music bot with a full-blown queue system that is easy to understand
Stars: ✭ 102 (-44.26%)
Mutual labels:  discord-api, discord
Discordpp
A Modularized C++ Library for the Discord API
Stars: ✭ 111 (-39.34%)
Mutual labels:  discord-api, discord
Nino
🔨 Advanced and cute moderation discord bot as an entry of Discord's Hack Week!
Stars: ✭ 78 (-57.38%)
Mutual labels:  discord-api, discord
Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+8879.23%)
Mutual labels:  discord-api, discord
Arikawa
A Golang library and framework for the Discord API.
Stars: ✭ 123 (-32.79%)
Mutual labels:  discord-api, discord
Sword
Discord library for Swift
Stars: ✭ 166 (-9.29%)
Mutual labels:  discord-api, discord
Discord.net
An unofficial .Net wrapper for the Discord API (http://discordapp.com)
Stars: ✭ 2,253 (+1131.15%)
Mutual labels:  discord-api, discord
Discord.js Menu
💬 Easily create Discord.js v12 embed menus with reactions and unlimited customizable pages.
Stars: ✭ 89 (-51.37%)
Mutual labels:  discord-api, discord
Swiftdiscord
Discord API Client for Swift
Stars: ✭ 103 (-43.72%)
Mutual labels:  discord-api, discord
Client
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
Stars: ✭ 84 (-54.1%)
Mutual labels:  discord-api, discord
Discljord
A Clojure wrapper library for the Discord API, with full API coverage (except voice, for now), and high scalability
Stars: ✭ 111 (-39.34%)
Mutual labels:  discord-api, discord
Discordrpcvs
An extension for Visual Studio 2017 that enables Discord Rich Presence.
Stars: ✭ 77 (-57.92%)
Mutual labels:  discord-api, discord
Bot
A Discord bot for all your needs. With memes, utilities, moderation & more, Fire is the only bot you'll need.
Stars: ✭ 79 (-56.83%)
Mutual labels:  discord-api, discord
Discord Panel
📊 User friendly dashboard/tool for discord bot developpers to manage servers
Stars: ✭ 116 (-36.61%)
Mutual labels:  discord-api, discord
Discordcr
Minimalist Discord library for Crystal. (Still WIP, but usable)
Stars: ✭ 137 (-25.14%)
Mutual labels:  discord-api, discord


discord-py-slash-command

A simple discord slash command handler for discord.py

Codacy Badge Discord

About ⦿ Installation ⦿ Disclaimer ⦿ Examples ⦿ Documentation ⦿ Discussions ⦿ Discord Server

About

Discord Slash Commands are a new implementation for the Bot API that utilize the forward-slash "/" symbol. Released on 15 December 2020, many bot developers are still learning to learn how to implement this into their very own bots. This command handler aims to help serve as a guidance for those looking into wanting to add these new slash commands into their bots for those that use discord.py, building off of the current library code and substituting its own for where it's needed. discord-py-slash-command stands as the first public slash command handler library to be made for Discord Bot API libraries.

Installation

You are able to easily install the discord-py-slash-command library by using the given PIP line below:

pip install -U discord-py-slash-command

Disclaimer

Since slash commands are currently not officially released (They're in public beta), there will be many breaking changes to this extension which may cause it to become unstable. It is recommended to wait until discord officially releases slash commands. Waiting until Release 1.1.0, which is planned to have most features implemented in the code, is also recommended. At this time, the developer of discord.py has no plans to officially support slash commands for their library.

Examples

Quick Startup

This is a quick startup method towards using slash commands.

import discord
from discord.ext import commands
from discord_slash import SlashCommand, SlashContext

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
slash = SlashCommand(bot)

@slash.slash(name="test")
async def _test(ctx: SlashContext):
    embed = discord.Embed(title="embed test")
    await ctx.send(content="test", embeds=[embed])

bot.run("discord_token")

Advanced

This offers implementation of the slash command library in the usage of a cog.

# bot.py
from discord.ext import commands
from discord_slash import SlashCommand

bot = commands.Bot(command_prefix="prefix")
slash = SlashCommand(bot, override_type = True)

bot.load_extension("cog")
bot.run("TOKEN")

# cog.py
import discord
from discord.ext import commands
from discord_slash import cog_ext, SlashContext

class Slash(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @cog_ext.cog_slash(name="test")
    async def _test(self, ctx: SlashContext):
        embed = discord.Embed(title="embed test")
        await ctx.send(content="test", embeds=[embed])

def setup(bot):
    bot.add_cog(Slash(bot))

This library is based on gateway event. If you are looking for webserver based, have a look at this:
dispike
discord-interactions-python
Or for other languages:
discord-api-docs Community Resources: Interactions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].