Browse Source

[commands] Add overload to run_converters

pull/10109/head
Josh 3 years ago
committed by dolfies
parent
commit
1307883f56
  1. 13
      discord/ext/commands/converter.py

13
discord/ext/commands/converter.py

@ -35,6 +35,7 @@ from typing import (
List,
Literal,
Optional,
overload,
Protocol,
Tuple,
Type,
@ -1232,6 +1233,18 @@ async def _actual_conversion(ctx: Context[BotT], converter, argument: str, param
raise BadArgument(f'Converting to "{name}" failed for parameter "{param.name}".') from exc
@overload
async def run_converters(
ctx: Context[BotT], converter: Union[Type[Converter[T]], Converter[T]], argument: str, param: Parameter
) -> T:
...
@overload
async def run_converters(ctx: Context[BotT], converter: Any, argument: str, param: Parameter) -> Any:
...
async def run_converters(ctx: Context[BotT], converter: Any, argument: str, param: Parameter) -> Any:
"""|coro|

Loading…
Cancel
Save