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
# pip install discord.py | |
import discord | |
from discord.ext import commands | |
intents = discord.Intents.default() | |
intents.message_context = True | |
bot = commands.Bot(command_prefix="!", intents=intents) | |
@bot.command() |
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 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) |