Skip to content
This repository was archived by the owner on Aug 28, 2019. It is now read-only.

Commit fa40475

Browse files
committed
Change abc.PrivateChannel to be a proper subclass
This fixes isinstance(thread, discord.abc.PrivateChannel) from returning True
1 parent fd9c244 commit fa40475

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

discord/abc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ def mentioned_in(self, message: Message) -> bool:
272272
raise NotImplementedError
273273

274274

275-
@runtime_checkable
276-
class PrivateChannel(Snowflake, Protocol):
275+
class PrivateChannel:
277276
"""An ABC that details the common operations on a private Discord channel.
278277
279278
The following implement this ABC:

discord/channel.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,7 @@ async def create_webhook(self, *, name: str, avatar: Optional[bytes] = None, rea
23812381
return Webhook.from_state(data, state=self._state)
23822382

23832383

2384-
class DMChannel(discord.abc.Messageable, Hashable):
2384+
class DMChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable):
23852385
"""Represents a Discord direct message channel.
23862386
23872387
.. container:: operations
@@ -2533,7 +2533,7 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:
25332533
return PartialMessage(channel=self, id=message_id)
25342534

25352535

2536-
class GroupChannel(discord.abc.Messageable, Hashable):
2536+
class GroupChannel(discord.abc.Messageable, discord.abc.PrivateChannel, Hashable):
25372537
"""Represents a Discord group channel.
25382538
25392539
.. container:: operations

0 commit comments

Comments
 (0)