В данном коде, про попытке выбрать опцию(подгружаются в строковом формате)
в interaction = ... программа обламывается с выбором опции
@bot.slash_command(name='online', help="1", description="2")
async def online(inter):
try:
options_list = [param['name'] for param in params]
options = [SelectOption(label=option, value=option, default = 0) for option in options_list]
select = Select(options=options, placeholder="Игра")
win = await inter.response.send_message("Выберите игру:", components=[select], ephemeral=True, delete_after=10)
#await inter.response.defer()
interaction = await bot.wait_for("select_option",
check=lambda i: i.component == select and i.message.id == win.id, timeout=30)
print("passed")
selected_option = interaction.component.selected_options[0].value
print(f"Selected option: {selected_option}")
server = JavaServer.lookup(f"{params[0]['ip'] + str(params[0]['port'])}")
status = server.status()
message = f"На сервере сейчас играют {status.players.online} игроков."
except asyncio.TimeoutError:
await inter.send("Превышено время ожидания выбора игры.", ephemeral=True)
except Exception as error:
await inter.send(str(error), ephemeral = True)