Browse Source

Change abc.PrivateChannel to be a proper subclass

This fixes isinstance(thread, discord.abc.PrivateChannel) from
returning True
pull/10109/head
Rapptz 3 years ago
committed by dolfies
parent
commit
7c71feac23
  1. 4
      discord/abc.py
  2. 4
      discord/channel.py

4
discord/abc.py

@ -369,8 +369,7 @@ class User(Snowflake, Protocol):
raise NotImplementedError
@runtime_checkable
class PrivateChannel(Snowflake, Protocol):
class PrivateChannel:
"""An ABC that details the common operations on a private Discord channel.
The following implement this ABC:
@ -388,6 +387,7 @@ class PrivateChannel(Snowflake, Protocol):
__slots__ = ()
id: int
me: ClientUser
def _add_call(self, **kwargs):

4
discord/channel.py

@ -2301,7 +2301,7 @@ class ForumChannel(discord.abc.GuildChannel, Hashable):
return Webhook.from_state(data, state=self._state)
class DMChannel(discord.abc.Messageable, discord.abc.Connectable, Hashable):
class DMChannel(discord.abc.Messageable, discord.abc.Connectable, discord.abc.PrivateChannel, Hashable):
"""Represents a Discord direct message channel.
.. container:: operations
@ -2640,7 +2640,7 @@ class DMChannel(discord.abc.Messageable, discord.abc.Connectable, Hashable):
await self._state.http.decline_message_request(self.id)
class GroupChannel(discord.abc.Messageable, discord.abc.Connectable, Hashable):
class GroupChannel(discord.abc.Messageable, discord.abc.Connectable, discord.abc.PrivateChannel, Hashable):
"""Represents a Discord group channel.
.. container:: operations

Loading…
Cancel
Save