mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-10 18:09:03 +00:00
Add TextChannel.get_thread shortcut helper
This commit is contained in:
1 parent
b2176dc0ef
commit
3a421a3eb9
1 file changed
+17
@@ -589,6 +589,23 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
from .message import PartialMessage
|
from .message import PartialMessage
|
||||||
return PartialMessage(channel=self, id=message_id)
|
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(
|
async def start_thread(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
|||||||
Reference in new issue
Block a user