mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 01:09:50 +00:00
Fix type checker errors in Connectable and Messageable
This commit is contained in:
parent
1f8687505f
commit
4b2c2b231d
@ -1250,7 +1250,7 @@ class Messageable:
|
|||||||
self,
|
self,
|
||||||
content=None,
|
content=None,
|
||||||
*,
|
*,
|
||||||
tts=None,
|
tts=False,
|
||||||
embed=None,
|
embed=None,
|
||||||
embeds=None,
|
embeds=None,
|
||||||
file=None,
|
file=None,
|
||||||
@ -1735,7 +1735,8 @@ class Connectable(Protocol):
|
|||||||
if cls is MISSING:
|
if cls is MISSING:
|
||||||
cls = VoiceClient
|
cls = VoiceClient
|
||||||
|
|
||||||
voice = cls(client, self)
|
# The type checker doesn't understand that VoiceClient *is* T here.
|
||||||
|
voice: T = cls(client, self) # type: ignore
|
||||||
|
|
||||||
if not isinstance(voice, VoiceProtocol):
|
if not isinstance(voice, VoiceProtocol):
|
||||||
raise TypeError('Type must meet VoiceProtocol abstract base class.')
|
raise TypeError('Type must meet VoiceProtocol abstract base class.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user