-
in the slash command menu, i want there to be catogory and i want the options to be ['Support', 'Account', 'Other'] i dont want to use this: if category not in ['Support', 'Account', 'Other']:
await ctx.send('Invalid category. Please choose from Support, Account, or Other.')
return as its not a actual choice menu in discord code: import discord
from discord import app_commands
client = discord.Client(intents=discord.Intents.all())
tree = app_commands.CommandTree(client)
@client.event
async def on_ready():
await tree.sync(guild=discord.Object(id=1198364542334406776))
print(f'Bot logged in as {client.user} ({client.user.id}). Commands synced.')
@tree.command(name="ticket", description="Create a support ticket", guild=discord.Object(id=1198364542334406776))
async def ticket(interaction, reason: str, catogory: str):
interaction.response.send_message("This command is not yet implemented.", ephemeral=True)
client.run('no') |
Beta Was this translation helpful? Give feedback.
Answered by
Rapptz
Feb 9, 2024
Replies: 1 comment 4 replies
-
You can use |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
typing.Literal
or decorate the parameter withchoices
. Check the documentation for more information.