From 18854c0124ffb110d2b412abafa56f6c9d353627 Mon Sep 17 00:00:00 2001 From: mirnovov Date: Wed, 17 Aug 2022 08:59:20 +1200 Subject: [PATCH] Document get_thread not fetching archived threads --- discord/channel.py | 5 +++++ discord/guild.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index 488fb24bc..ac3a61913 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -646,6 +646,11 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): def get_thread(self, thread_id: int, /) -> Optional[Thread]: """Returns a thread with the given ID. + .. note:: + + This does not always retrieve archived threads, as they are not retained in the internal + cache. Use :func:`Guild.fetch_channel` instead. + .. versionadded:: 2.0 Parameters diff --git a/discord/guild.py b/discord/guild.py index 77a2148e5..533bff67c 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -774,6 +774,11 @@ class Guild(Hashable): def get_thread(self, thread_id: int, /) -> Optional[Thread]: """Returns a thread with the given ID. + .. note:: + + This does not always retrieve archived threads, as they are not retained in the internal + cache. Use :func:`fetch_channel` instead. + .. versionadded:: 2.0 Parameters