[commands] Add overload to run_converters

This commit is contained in:
Josh 2022-04-17 19:28:16 +10:00 committed by GitHub
parent 18a6881fd9
commit 9fcb3c8871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,7 @@ from typing import (
List,
Literal,
Optional,
overload,
Protocol,
Tuple,
Type,
@ -1242,6 +1243,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|