mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-17 11:19:00 +00:00
Change abc.PrivateChannel to be a proper subclass
This fixes isinstance(thread, discord.abc.PrivateChannel) from returning True
This commit is contained in:
parent
fd9c244f48
commit
5de9287902
@ -272,8 +272,7 @@ class User(Snowflake, Protocol):
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
@runtime_checkable
|
class PrivateChannel:
|
||||||
class PrivateChannel(Snowflake, Protocol):
|
|
||||||
"""An ABC that details the common operations on a private Discord channel.
|
"""An ABC that details the common operations on a private Discord channel.
|
||||||
|
|
||||||
The following implement this ABC:
|
The following implement this ABC:
|
||||||
@ -291,6 +290,7 @@ class PrivateChannel(Snowflake, Protocol):
|
|||||||
|
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
|
id: int
|
||||||
me: ClientUser
|
me: ClientUser
|
||||||
|
|
||||||
|
|
||||||
|
@ -2381,7 +2381,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
|
|||||||
return Webhook.from_state(data, state=self._state)
|
return Webhook.from_state(data, state=self._state)
|
||||||
|
|
||||||
|
|
||||||
class DMChannel(discord.abc.Messageable, Hashable):
|
class DMChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable):
|
||||||
"""Represents a Discord direct message channel.
|
"""Represents a Discord direct message channel.
|
||||||
|
|
||||||
.. container:: operations
|
.. container:: operations
|
||||||
@ -2533,7 +2533,7 @@ class DMChannel(discord.abc.Messageable, Hashable):
|
|||||||
return PartialMessage(channel=self, id=message_id)
|
return PartialMessage(channel=self, id=message_id)
|
||||||
|
|
||||||
|
|
||||||
class GroupChannel(discord.abc.Messageable, Hashable):
|
class GroupChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable):
|
||||||
"""Represents a Discord group channel.
|
"""Represents a Discord group channel.
|
||||||
|
|
||||||
.. container:: operations
|
.. container:: operations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user