Skip to content

gunyu1019/discord-extension-interaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Extension Interaction

Release Release Release

Introduce

Slash Command is supported through discord.py.
Based on discord.ext.commands, compatible with existing frames.

Compatibility list

Moudle Name Version Tested
discord.py v2.3.0 ✔️
Pycord v2.4.1
  • Plans to support py-cord, but discord-extension-interaction is not supported now.

Installing

Python 3.9 or higher is required.

To install the library without full voice support, you can just run the following command:

# Linux/macOS
python3 -m pip install -U discord-extension-interaction

# Windows
py -3 -m pip install -U discord-extension-interaction

To install the library with discord.py

# Linux/macOS
python3 -m pip install -U discord-extension-interaction[discordpy]

# Windows
py -3 -m pip install -U discord-extension-interaction[discordpy]

To install the development version, do the following:

$ git clone https://github.com/gunyu1019/discord-extension-interaction
$ cd discord-extension-interaction
$ python3 -m pip install -U .

Quick Example

from discord.ext import interaction
from discord import Intents

intents = Intents.default()
bot = interaction.Client(global_sync_command=True, intents = intents)


@interaction.command(description="This is ping")
async def ping(ctx: interaction.ApplicationContext):
    await ctx.send("pong!")
    return

bot.add_interaction(ping)
bot.run("TOKEN")

You can find more examples in the examples directory.