Skip to content

Commit

Permalink
fix: skip BridgeContext when parsing options (#2337)
Browse files Browse the repository at this point in the history
* fix: don't raise for BridgeContext

* fix: circular import

* chore: add changelog entry
  • Loading branch information
Dorukyum committed Jan 29, 2024
1 parent 5d2ec72 commit 7192260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion discord/enums.py
Expand Up @@ -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"
Expand Down

0 comments on commit 7192260

Please sign in to comment.