Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip BridgeContext when parsing options #2337

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading