mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
Fix partially uknown typing errors
This commit is contained in:
parent
6910943703
commit
1de3562f34
@ -1161,9 +1161,9 @@ class Client:
|
|||||||
event: Literal['app_command_completion'],
|
event: Literal['app_command_completion'],
|
||||||
/,
|
/,
|
||||||
*,
|
*,
|
||||||
check: Optional[Callable[[Interaction[Self], Union[Command, ContextMenu]], bool]],
|
check: Optional[Callable[[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]], bool]],
|
||||||
timeout: Optional[float] = None,
|
timeout: Optional[float] = None,
|
||||||
) -> Tuple[Interaction[Self], Union[Command, ContextMenu]]:
|
) -> Tuple[Interaction[Self], Union[Command[Any, Any, Any], ContextMenu]]:
|
||||||
...
|
...
|
||||||
|
|
||||||
# AutoMod
|
# AutoMod
|
||||||
@ -1816,9 +1816,9 @@ class Client:
|
|||||||
event: Literal["command", "command_completion"],
|
event: Literal["command", "command_completion"],
|
||||||
/,
|
/,
|
||||||
*,
|
*,
|
||||||
check: Optional[Callable[[Context], bool]] = None,
|
check: Optional[Callable[[Context[Any]], bool]] = None,
|
||||||
timeout: Optional[float] = None,
|
timeout: Optional[float] = None,
|
||||||
) -> Context:
|
) -> Context[Any]:
|
||||||
...
|
...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
@ -1827,9 +1827,9 @@ class Client:
|
|||||||
event: Literal["command_error"],
|
event: Literal["command_error"],
|
||||||
/,
|
/,
|
||||||
*,
|
*,
|
||||||
check: Optional[Callable[[Context, CommandError], bool]] = None,
|
check: Optional[Callable[[Context[Any], CommandError], bool]] = None,
|
||||||
timeout: Optional[float] = None,
|
timeout: Optional[float] = None,
|
||||||
) -> Tuple[Context, CommandError]:
|
) -> Tuple[Context[Any], CommandError]:
|
||||||
...
|
...
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
@ -40,7 +40,7 @@ if TYPE_CHECKING:
|
|||||||
from .view import View
|
from .view import View
|
||||||
from ..components import Component
|
from ..components import Component
|
||||||
|
|
||||||
I = TypeVar('I', bound='Item')
|
I = TypeVar('I', bound='Item[Any]')
|
||||||
V = TypeVar('V', bound='View', covariant=True)
|
V = TypeVar('V', bound='View', covariant=True)
|
||||||
ItemCallbackType = Callable[[V, Interaction[Any], I], Coroutine[Any, Any, Any]]
|
ItemCallbackType = Callable[[V, Interaction[Any], I], Coroutine[Any, Any, Any]]
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|||||||
DEALINGS IN THE SOFTWARE.
|
DEALINGS IN THE SOFTWARE.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from typing import List, Literal, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Callable, Union, Dict, overload
|
from typing import Any, List, Literal, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Callable, Union, Dict, overload
|
||||||
from contextvars import ContextVar
|
from contextvars import ContextVar
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
@ -71,12 +71,12 @@ if TYPE_CHECKING:
|
|||||||
]
|
]
|
||||||
|
|
||||||
V = TypeVar('V', bound='View', covariant=True)
|
V = TypeVar('V', bound='View', covariant=True)
|
||||||
BaseSelectT = TypeVar('BaseSelectT', bound='BaseSelect')
|
BaseSelectT = TypeVar('BaseSelectT', bound='BaseSelect[Any]')
|
||||||
SelectT = TypeVar('SelectT', bound='Select')
|
SelectT = TypeVar('SelectT', bound='Select[Any]')
|
||||||
UserSelectT = TypeVar('UserSelectT', bound='UserSelect')
|
UserSelectT = TypeVar('UserSelectT', bound='UserSelect[Any]')
|
||||||
RoleSelectT = TypeVar('RoleSelectT', bound='RoleSelect')
|
RoleSelectT = TypeVar('RoleSelectT', bound='RoleSelect[Any]')
|
||||||
ChannelSelectT = TypeVar('ChannelSelectT', bound='ChannelSelect')
|
ChannelSelectT = TypeVar('ChannelSelectT', bound='ChannelSelect[Any]')
|
||||||
MentionableSelectT = TypeVar('MentionableSelectT', bound='MentionableSelect')
|
MentionableSelectT = TypeVar('MentionableSelectT', bound='MentionableSelect[Any]')
|
||||||
SelectCallbackDecorator: TypeAlias = Callable[[ItemCallbackType[V, BaseSelectT]], BaseSelectT]
|
SelectCallbackDecorator: TypeAlias = Callable[[ItemCallbackType[V, BaseSelectT]], BaseSelectT]
|
||||||
|
|
||||||
selected_values: ContextVar[Dict[str, List[PossibleValue]]] = ContextVar('selected_values')
|
selected_values: ContextVar[Dict[str, List[PossibleValue]]] = ContextVar('selected_values')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user