Skip to content

Commit e328249

Browse files
committed
fix: Single Item Enums Of Invalid Types Not Converting To String
1 parent 341fcce commit e328249

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

discord/commands/options.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ def __init__(
209209
)
210210
enum_choices = [OptionChoice(e.name, e.value) for e in input_type]
211211
value_class = enum_choices[0].value.__class__
212-
if all(isinstance(elem.value, value_class) for elem in enum_choices):
212+
if (enum_choices[0].value.__class__ in SlashCommandOptionType.__members__ and
213+
all(isinstance(elem.value, value_class) for elem in enum_choices)):
213214
input_type = SlashCommandOptionType.from_datatype(
214215
enum_choices[0].value.__class__
215216
)

0 commit comments

Comments
 (0)