Created
December 23, 2020 20:15
-
-
Save Malarne/61b4d3fe98d75fee307e77c2ec1c3200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
from discord_slash import SlashCommand | |
from discord_slash import SlashContext | |
from discord_slash.utils.manage_commands import add_slash_command | |
import asyncio | |
bot = commands.Bot(command_prefix="!", intents=discord.Intents.all()) | |
slash = SlashCommand(bot) | |
token = "" | |
@slash.slash(name="ping") | |
async def _test(ctx: SlashContext): | |
embed = discord.Embed(title="Slash command !", description="Pong !") | |
await ctx.send(content="\u200b", embeds=[embed]) | |
async def register(): | |
return await add_slash_command(353176642543419392 , token, None, "ping", "Pong !") | |
async def main(): | |
r = await register() | |
print(r) | |
asyncio.run(main()) | |
bot.run(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment