I installed discord.py using python3 -m pip install -U git+https://github.com/Rapptz/discord.py.
This is main.py
guild_id = 964345157480747029
import discord
from discord import app_commands
class aclient(discord.Client):
def __init__(self):
super().__init__(intents = discord.Intents.default())
self.synced = False #we use this so the bot doesn't sync commands more than once
async def on_ready(self):
await self.wait_until_ready()
if not self.synced: #check if slash commands have been synced
await tree.sync(guild = discord.Object(id=guild_id)) #guild specific: leave blank if global (global registration can take 1-24 hours)
self.synced = True
print(f"We have logged in as {self.user}.")
client = aclient()
tree = app_commands.CommandTree(client)
@tree.command(guild = discord.Object(id=guild_id), name = 'test', description='A test slash command') #guild specific slash command
async def slash2(interaction: discord.Interaction, text: str)
await interaction.response.send_message(f'You said "{text}"!')
client.run('token')
The slash command works, but I want the text option to have a description that says "Text to repeat".
I used this tutorial and got most of my code from here.
Please help. Thank you!