From fc6936b53bfccb7ac92f608230a40a56a0f2b9c3 Mon Sep 17 00:00:00 2001 From: Middledot Date: Sun, 2 Apr 2023 22:39:50 -0400 Subject: [PATCH 1/3] fix(ext.bridge): bool opt breaks sometimes --- discord/ext/bridge/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/discord/ext/bridge/core.py b/discord/ext/bridge/core.py index 0985526ab0..ec720afda8 100644 --- a/discord/ext/bridge/core.py +++ b/discord/ext/bridge/core.py @@ -529,11 +529,15 @@ async def convert(self, ctx: Context, arg: str): else: return attach +class BooleanConverter(Converter): + async def convert(self, ctx, arg: bool): + return _convert_to_bool(str(arg)) + BRIDGE_CONVERTER_MAPPING = { SlashCommandOptionType.string: str, SlashCommandOptionType.integer: int, - SlashCommandOptionType.boolean: lambda val: _convert_to_bool(str(val)), + SlashCommandOptionType.boolean: BooleanConverter, SlashCommandOptionType.user: UserConverter, SlashCommandOptionType.channel: GuildChannelConverter, SlashCommandOptionType.role: RoleConverter, @@ -577,3 +581,4 @@ async def convert(self, ctx, argument: str) -> Any: discord.commands.options.Option = BridgeOption +discord.Option = BridgeOption From 7f514224cfaf3b06340801459d4fc4726f1595f3 Mon Sep 17 00:00:00 2001 From: Middledot Date: Sun, 2 Apr 2023 22:54:24 -0400 Subject: [PATCH 2/3] chore(changelog): changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd044d7072..fb5a6c9c67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `AttributeError` caused by [#1957](https://github.com/Pycord-Development/pycord/pull/1957) when using listeners in cogs. ([#1989](https://github.com/Pycord-Development/pycord/pull/1989)) +- Fixed boolean converter breaking for bridge commands. + Fix bridge command Options not working. + ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) ## [2.4.1] - 2023-03-20 From e536a8f4d024a35deec0320501b23b0f669808eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 03:04:20 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGELOG.md | 5 ++--- discord/ext/bridge/core.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb5a6c9c67..47d7d70fd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,9 +36,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `AttributeError` caused by [#1957](https://github.com/Pycord-Development/pycord/pull/1957) when using listeners in cogs. ([#1989](https://github.com/Pycord-Development/pycord/pull/1989)) -- Fixed boolean converter breaking for bridge commands. - Fix bridge command Options not working. - ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) +- Fixed boolean converter breaking for bridge commands. Fix bridge command Options not + working. ([#1999](https://github.com/Pycord-Development/pycord/pull/1999)) ## [2.4.1] - 2023-03-20 diff --git a/discord/ext/bridge/core.py b/discord/ext/bridge/core.py index ec720afda8..e016ea9f8a 100644 --- a/discord/ext/bridge/core.py +++ b/discord/ext/bridge/core.py @@ -529,6 +529,7 @@ async def convert(self, ctx: Context, arg: str): else: return attach + class BooleanConverter(Converter): async def convert(self, ctx, arg: bool): return _convert_to_bool(str(arg))