From 7192260247e8d33b76b722bac6412bac6a5f5efd Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:53:20 +0300 Subject: [PATCH] fix: skip BridgeContext when parsing options (#2337) * fix: don't raise for BridgeContext * fix: circular import * chore: add changelog entry --- CHANGELOG.md | 2 ++ discord/enums.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fee4580268..157adbc5bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -222,6 +222,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2332](https://github.com/Pycord-Development/pycord/issues/2332)) - Fixed options declared using the 'default' syntax always being optional. ([#2333](https://github.com/Pycord-Development/pycord/issues/2333)) +- Fixed `BridgeContext` type hints raising an exception for unsupported option type. + ([#2337](https://github.com/Pycord-Development/pycord/pull/2337)) ## [2.4.1] - 2023-03-20 diff --git a/discord/enums.py b/discord/enums.py index f2bb6d3452..dd9aa1c16d 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -808,9 +808,10 @@ def from_datatype(cls, datatype): return cls.number from .commands.context import ApplicationContext + from .ext.bridge import BridgeContext if not issubclass( - datatype, ApplicationContext + datatype, (ApplicationContext, BridgeContext) ): # TODO: prevent ctx being passed here in cog commands raise TypeError( f"Invalid class {datatype} used as an input type for an Option"