aboutsummaryrefslogtreecommitdiff
path: root/discord/channel.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-05-04 10:15:00 -0400
committerRapptz <[email protected]>2021-06-08 07:26:22 -0400
commit3a421a3eb946474d848c713ad588c74cf0dcd0e1 (patch)
tree9756a987203a6a9bc4479d9f7fd287adf277c759 /discord/channel.py
parentChange how threads are created (diff)
downloaddiscord.py-3a421a3eb946474d848c713ad588c74cf0dcd0e1.tar.xz
discord.py-3a421a3eb946474d848c713ad588c74cf0dcd0e1.zip
Add TextChannel.get_thread shortcut helper
Diffstat (limited to 'discord/channel.py')
-rw-r--r--discord/channel.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py
index bf145f7a..291fd611 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -589,6 +589,23 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
from .message import PartialMessage
return PartialMessage(channel=self, id=message_id)
+ def get_thread(self, thread_id: int) -> Optional[Thread]:
+ """Returns a thread with the given ID.
+
+ .. versionadded:: 2.0
+
+ Parameters
+ -----------
+ thread_id: :class:`int`
+ The ID to search for.
+
+ Returns
+ --------
+ Optional[:class:`Thread`]
+ The returned thread or ``None`` if not found.
+ """
+ return self.guild.get_thread(thread_id)
+
async def start_thread(
self,
*,