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

chore(bridge): use BridgeOption instead of Option #2252

Merged
merged 13 commits into from
Jan 25, 2024
6 changes: 2 additions & 4 deletions discord/ext/bridge/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ async def convert(self, ctx, arg: bool):


class BridgeOption(Option, Converter):
"""Slash command option for bridge commands. Otherwise equivalent in every way to :class:`discord.Option`."""
Dorukyum marked this conversation as resolved.
Show resolved Hide resolved

async def convert(self, ctx, argument: str) -> Any:
try:
if self.converter is not None:
Expand Down Expand Up @@ -621,7 +623,3 @@ async def convert(self, ctx, argument: str) -> Any:
return converted
except ValueError as exc:
raise BadArgument() from exc


discord.commands.options.Option = BridgeOption
discord.Option = BridgeOption
6 changes: 6 additions & 0 deletions docs/ext/bridge/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,9 @@ BridgeContext Subclasses
.. data:: discord.ext.bridge.Context

Alias of :data:`typing.Union` [ :class:`.BridgeExtContext`, :class:`.BridgeApplicationContext` ] for typing convenience.

Option
------

BridgeOption
~~~~~~~~~~~~
Dorukyum marked this conversation as resolved.
Show resolved Hide resolved
Loading