From 5039b967a01e40bac38a8b73f72073a3d6fe2de9 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 1c0147e6d..f9c4f2cad 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -673,6 +673,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 a58078337..851476066 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -739,6 +739,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