Skip to content

Commit

Permalink
style(pre-commit): auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 16, 2024
1 parent 7fb1a4b commit 8805303
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#2556](https://github.com/Pycord-Development/pycord/pull/2556))

### Fixed

- Fix `Enum` options not setting the correct type when only one choice is available.
([#2575](https://github.com/Pycord-Development/pycord/pull/2575))

Expand All @@ -50,8 +51,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2555](https://github.com/Pycord-Development/pycord/pull/2555))
- Fixed missing `stacklevel` parameter in `warn_deprecated` function call inside
`@utils.deprecated`. ([#2500](https://github.com/Pycord-Development/pycord/pull/2500))
- Fixed the type hint in `ConnectionState._polls` to reflect actual behavior, changing it
from `Guild` to `Poll`.
- Fixed the type hint in `ConnectionState._polls` to reflect actual behavior, changing
it from `Guild` to `Poll`.
([#2500](https://github.com/Pycord-Development/pycord/pull/2500))
- Fixed missing `__slots__` attributes in `RawReactionClearEmojiEvent` and
`RawMessagePollVoteEvent`.
Expand Down
7 changes: 5 additions & 2 deletions discord/commands/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ def __init__(
)
enum_choices = [OptionChoice(e.name, e.value) for e in input_type]
value_class = enum_choices[0].value.__class__
if (enum_choices[0].value.__class__ in SlashCommandOptionType.__members__ and
all(isinstance(elem.value, value_class) for elem in enum_choices)):
if enum_choices[
0
].value.__class__ in SlashCommandOptionType.__members__ and all(
isinstance(elem.value, value_class) for elem in enum_choices
):
input_type = SlashCommandOptionType.from_datatype(
enum_choices[0].value.__class__
)
Expand Down

0 comments on commit 8805303

Please sign in to comment.