Skip to content

Commit

Permalink
Find the chosen enum value using the raw value
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Jul 4, 2022
1 parent 4cf035b commit ef301fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@ async def _invoke(self, ctx: ApplicationContext) -> None:
arg = op._raw_type(int(arg))
except ValueError:
arg = op._raw_type(arg)
else:
arg = op._raw_type(arg)
elif choice := find(lambda c: c.value == arg, op.choices):
arg = getattr(op._raw_type, choice.name)

kwargs[op._parameter_name] = arg

Expand Down

0 comments on commit ef301fc

Please sign in to comment.