Slash Options discord.py
Нашел в документации такой код:
@bot.slash_command(guild_ids=[TESTING_GUILD_ID])
async def choose_a_number(
interaction: nextcord.Interaction,
number: int = SlashOption(
name="picker",
choices={"one": 1, "two": 2, "three": 3},
),
):
"""Repeats your number that you choose from a list
Parameters
----------
interaction: Interaction
The interaction object
number: int
The chosen number.
"""
await interaction.response.send_message(f"You chose {number}!")
Заменил всё на своё но, Не нашёл как импортировать Slash Options, только нашёл:
from typing import Optional
Пробовал:
from discord.ext import SlashOption
import SlashOption
from types import SlashOption