Browse Source

Allow pins events to work with threads

feature/threads
Rapptz 4 years ago
parent
commit
1152f67efc
  1. 2
      discord/state.py
  2. 2
      docs/api.rst

2
discord/state.py

@ -1249,7 +1249,7 @@ class ConnectionState:
return pm return pm
for guild in self.guilds: for guild in self.guilds:
channel = guild.get_channel(id) channel = guild.get_channel(id) or guild.get_thread(id)
if channel is not None: if channel is not None:
return channel return channel

2
docs/api.rst

@ -654,7 +654,7 @@ to handle it, which defaults to print a traceback and ignoring the exception.
This requires :attr:`Intents.guilds` to be enabled. This requires :attr:`Intents.guilds` to be enabled.
:param channel: The guild channel that had its pins updated. :param channel: The guild channel that had its pins updated.
:type channel: :class:`abc.GuildChannel` :type channel: Union[:class:`abc.GuildChannel`, :class:`Thread`]
:param last_pin: The latest message that was pinned as an aware datetime in UTC. Could be ``None``. :param last_pin: The latest message that was pinned as an aware datetime in UTC. Could be ``None``.
:type last_pin: Optional[:class:`datetime.datetime`] :type last_pin: Optional[:class:`datetime.datetime`]

Loading…
Cancel
Save