Skip to content

Commit 98c1f39

Browse files
MiddledotLulalaby
andauthored
Fix enum options (#1359)
Co-authored-by: Lala Sabathil <[email protected]>
1 parent fce0e87 commit 98c1f39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

discord/commands/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
)
5050

5151
from ..channel import _guild_channel_factory
52-
from ..enums import MessageType, SlashCommandOptionType, try_enum
52+
from ..enums import MessageType, SlashCommandOptionType, try_enum, Enum as DiscordEnum
5353
from ..errors import (
5454
ApplicationCommandError,
5555
ApplicationCommandInvokeError,
@@ -693,6 +693,8 @@ def _parse_options(self, params, *, check_params: bool = True) -> List[Option]:
693693
if option.default is None:
694694
if p_obj.default == inspect.Parameter.empty:
695695
option.default = None
696+
elif issubclass(p_obj.default, (DiscordEnum, Enum)):
697+
option = Option(p_obj.default)
696698
else:
697699
option.default = p_obj.default
698700
option.required = False

0 commit comments

Comments
 (0)