Skip to content

Instantly share code, notes, and snippets.

@Fatih5252
Last active December 26, 2023 14:57
Show Gist options
  • Save Fatih5252/99d304d063ad29b9df4e7730a5c1f086 to your computer and use it in GitHub Desktop.
Save Fatih5252/99d304d063ad29b9df4e7730a5c1f086 to your computer and use it in GitHub Desktop.
how to make slash commands on discord (discord.py)
import discord
from discord.ext import app_commands
intents = discord.Intents.default()
client = aclient()
tree = app_commands.CommnadTree(client)
@tree.command(name = "hello", description = "say hello!", guild = discord.Object(id = SERVER ID))
async def self(interaction: discord.Interaction, name: str)
await interaction.response.send_message(f"Hello {name}!", ephemeral = True)
client.run(BOT TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment