Skip to content

Instantly share code, notes, and snippets.

@NixonXC
Last active September 18, 2021 09:56
Show Gist options
  • Save NixonXC/68df38996c06167a457ae5ef0f932b3e to your computer and use it in GitHub Desktop.
Save NixonXC/68df38996c06167a457ae5ef0f932b3e to your computer and use it in GitHub Desktop.
slash commands
import discord
bot = discord.Bot()
@bot.slash_command()
async def ping(ctx):
"""Check My Ping"""
await ctx.send(f"Pong! `{round(bot.latency * 1000)}ms`")
@bot.slash_command()
async def hello(ctx):
"""Hello!"""
await ctx.send(f"Hello {ctx.author.mention}!")
@bot.event
async def on_ready():
print("ready")
bot.run("You bot's Token")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment