Answers for "python slash commands"

0

python 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")
#SOURCE: https://pypi.org/project/discord-py-slash-command/
Posted by: Guest on May-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language