rdrescher909
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
25 additions and
0 deletions
-
discord/channel.py
|
|
@ -2204,6 +2204,31 @@ class ForumChannel(discord.abc.GuildChannel, Hashable): |
|
|
|
base.value &= ~denied.value |
|
|
|
return base |
|
|
|
|
|
|
|
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.2 |
|
|
|
|
|
|
|
Parameters |
|
|
|
----------- |
|
|
|
thread_id: :class:`int` |
|
|
|
The ID to search for. |
|
|
|
|
|
|
|
Returns |
|
|
|
-------- |
|
|
|
Optional[:class:`Thread`] |
|
|
|
The returned thread or ``None`` if not found. |
|
|
|
""" |
|
|
|
thread = self.guild.get_thread(thread_id) |
|
|
|
if thread is not None and thread.parent_id == self.id: |
|
|
|
return thread |
|
|
|
return None |
|
|
|
|
|
|
|
@property |
|
|
|
def threads(self) -> List[Thread]: |
|
|
|
"""List[:class:`Thread`]: Returns all the threads that you can see.""" |
|
|
|