mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Use typing.Self throughout library
This commit is contained in:
@ -36,7 +36,7 @@ import sys
|
||||
import re
|
||||
import io
|
||||
|
||||
from typing import Any, Callable, Generic, IO, Optional, TYPE_CHECKING, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Generic, IO, Optional, TYPE_CHECKING, Tuple, TypeVar, Union
|
||||
|
||||
from .enums import SpeakingState
|
||||
from .errors import ClientException
|
||||
@ -45,11 +45,12 @@ from .oggparse import OggStream
|
||||
from .utils import MISSING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing_extensions import Self
|
||||
|
||||
from .voice_client import VoiceClient
|
||||
|
||||
|
||||
AT = TypeVar('AT', bound='AudioSource')
|
||||
FT = TypeVar('FT', bound='FFmpegOpusAudio')
|
||||
|
||||
_log = logging.getLogger(__name__)
|
||||
|
||||
@ -402,12 +403,12 @@ class FFmpegOpusAudio(FFmpegAudio):
|
||||
|
||||
@classmethod
|
||||
async def from_probe(
|
||||
cls: Type[FT],
|
||||
cls,
|
||||
source: str,
|
||||
*,
|
||||
method: Optional[Union[str, Callable[[str, str], Tuple[Optional[str], Optional[int]]]]] = None,
|
||||
**kwargs: Any,
|
||||
) -> FT:
|
||||
) -> Self:
|
||||
"""|coro|
|
||||
|
||||
A factory method that creates a :class:`FFmpegOpusAudio` after probing
|
||||
|
Reference in New Issue
Block a user