Skip to content

Commit

Permalink
chore(bridge): force BridgeOption
Browse files Browse the repository at this point in the history
  • Loading branch information
Middledot committed Oct 29, 2023
1 parent 927f8ce commit f719cbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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`."""

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
~~~~~~~~~~~~

0 comments on commit f719cbc

Please sign in to comment.