Last active
December 26, 2023 14:57
-
-
Save Fatih5252/99d304d063ad29b9df4e7730a5c1f086 to your computer and use it in GitHub Desktop.
how to make slash commands on discord (discord.py)
This file contains hidden or 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 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