From 8805303f7652fdffa7f22b7a0933ac7ac33da71f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:16:42 +0000 Subject: [PATCH] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 5 +++-- discord/commands/options.py | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eaa86f65f..7f2ec26349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) @@ -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`. diff --git a/discord/commands/options.py b/discord/commands/options.py index 06b15f82ed..81a3484771 100644 --- a/discord/commands/options.py +++ b/discord/commands/options.py @@ -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__ )