Skip to content

Commit 8043947

Browse files
committed
fix: Fixed OptionType.from_type not working with direct enum values
1 parent 13afc3f commit 8043947

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ def from_type(cls, t):
439439
else:
440440
t = args[0] # not the best solution, but we shall not get here
441441
if isinstance(t, int):
442-
return cls.try_value(t)
442+
return try_enum(cls, t), None
443443
elif isinstance(t, str):
444-
return cls[t]
444+
return cls[t], None
445445
if issubclass(t, str):
446446
return cls.string, None
447447
if issubclass(t, bool):

0 commit comments

Comments
 (0)