mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
parent
11618cd1ba
commit
5527de688a
@ -24,7 +24,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, TYPE_CHECKING, List, Optional, Type, Union
|
from typing import Any, TYPE_CHECKING, List, Optional, Union
|
||||||
|
|
||||||
|
|
||||||
from ..enums import AppCommandOptionType, AppCommandType
|
from ..enums import AppCommandOptionType, AppCommandType
|
||||||
|
@ -202,6 +202,9 @@ class Transformer:
|
|||||||
def __call__(self) -> None:
|
def __call__(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __or__(self, rhs: Any) -> Any:
|
||||||
|
return Union[self, rhs] # type: ignore
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self) -> AppCommandOptionType:
|
def type(self) -> AppCommandOptionType:
|
||||||
""":class:`~discord.AppCommandOptionType`: The option type associated with this transformer.
|
""":class:`~discord.AppCommandOptionType`: The option type associated with this transformer.
|
||||||
|
@ -142,7 +142,7 @@ class ConverterTransformer(app_commands.Transformer):
|
|||||||
else:
|
else:
|
||||||
return await converter().convert(ctx, value) # type: ignore
|
return await converter().convert(ctx, value) # type: ignore
|
||||||
elif isinstance(converter, Converter):
|
elif isinstance(converter, Converter):
|
||||||
return await converter.convert(ctx, value) # type: ignore
|
return await converter.convert(ctx, value)
|
||||||
except CommandError:
|
except CommandError:
|
||||||
raise
|
raise
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user