We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
choices
create_option
1 parent 69f125d commit dd8719cCopy full SHA for dd8719c
discord_slash/utils/manage_commands.py
@@ -166,13 +166,14 @@ def create_option(name: str,
166
option_type = SlashCommandOptionType.from_type(original_type)
167
if option_type is None:
168
raise IncorrectType(f"The type {original_type} is not recognized as a type that Discord accepts for slash commands.")
169
+ choices = choices or []
170
choices = [choice if isinstance(choice, dict) else {"name": choice, "value": choice} for choice in choices]
171
return {
172
"name": name,
173
"description": description,
174
"type": option_type,
175
"required": required,
- "choices": choices or []
176
+ "choices": choices
177
}
178
179
0 commit comments