Skip to content

Commit 1e59007

Browse files
committed
feat(bridge): enhance BridgeOption initialization with converter support
1 parent 8fea298 commit 1e59007

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

discord/ext/bridge/core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,16 @@ class BridgeOption(Option, Converter):
632632
command option and a prefixed command argument for bridge commands.
633633
"""
634634

635+
def __init__(self, input_type, *args, **kwargs):
636+
self.converter = kwargs.pop("converter", None)
637+
super().__init__(input_type, *args, **kwargs)
638+
639+
if self.converter is None:
640+
if input_type == discord.Member:
641+
self.converter = MemberConverter()
642+
else:
643+
self.converter = BRIDGE_CONVERTER_MAPPING.get(input_type)
644+
635645
async def convert(self, ctx, argument: str) -> Any:
636646
try:
637647
if self.converter is not None:

0 commit comments

Comments
 (0)