From 1152f67efc9142072e82fe76d307729839dadca9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 23 May 2021 22:23:40 -0400 Subject: [PATCH] Allow pins events to work with threads --- discord/state.py | 2 +- docs/api.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/state.py b/discord/state.py index ec93590b5..94a1a62a5 100644 --- a/discord/state.py +++ b/discord/state.py @@ -1249,7 +1249,7 @@ class ConnectionState: return pm 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: return channel diff --git a/docs/api.rst b/docs/api.rst index 395de4771..0aeea2f7b 100644 --- a/docs/api.rst +++ b/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. :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``. :type last_pin: Optional[:class:`datetime.datetime`]