discord-py-interactions 5.11.0
Python 3.11.6
I think the try statement is at fault?
`
from config import TOKEN, GUILD_ID
from interactions import Client, slash_command
from interactions import StringSelectMenu
bot = Client(token=TOKEN)
@slash_command(name="show_menu", description="Show a StringSelectMenu", scopes=[GUILD_ID])
async def show_menu(ctx):
select_menu = StringSelectMenu(
"Option 1",
"Option 2",
"Option 3",
placeholder="Choose an option...",
min_values=1,
max_values=1,
)
response = await ctx.send("Which option?:", components=[select_menu])
try:
interaction = await bot.wait_for("select_option",checks=[],timeout=60)
selected_option = interaction.values[0]
# Validate the response
if selected_option == "Option 1":
await interaction.send_message("You selected Option 1!")
elif selected_option == "Option 2":
await interaction.send_message("You selected Option 2!")
elif selected_option == "Option 3":
await interaction.send_message("You selected Option 3!")
except TimeoutError:
await response.send("You took too long to respond. Please try again.")
bot.start()
`