jack1142
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
25 additions and
0 deletions
-
discord/http.py
-
discord/threads.py
|
|
@ -975,6 +975,10 @@ class HTTPClient: |
|
|
|
route = Route('GET', '/guilds/{guild_id}/threads/active', guild_id=guild_id) |
|
|
|
return self.request(route) |
|
|
|
|
|
|
|
def get_thread_member(self, channel_id: Snowflake, user_id: Snowflake) -> Response[threads.ThreadMember]: |
|
|
|
route = Route('GET', '/channels/{channel_id}/thread-members/{user_id}', channel_id=channel_id, user_id=user_id) |
|
|
|
return self.request(route) |
|
|
|
|
|
|
|
def get_thread_members(self, channel_id: Snowflake) -> Response[List[threads.ThreadMember]]: |
|
|
|
route = Route('GET', '/channels/{channel_id}/thread-members', channel_id=channel_id) |
|
|
|
return self.request(route) |
|
|
|
|
|
@ -663,6 +663,27 @@ class Thread(Messageable, Hashable): |
|
|
|
""" |
|
|
|
await self._state.http.remove_user_from_thread(self.id, user.id) |
|
|
|
|
|
|
|
async def fetch_member(self, user_id: int, /) -> ThreadMember: |
|
|
|
"""|coro| |
|
|
|
|
|
|
|
Retrieves a :class:`ThreadMember` for the given user ID. |
|
|
|
|
|
|
|
Raises |
|
|
|
------- |
|
|
|
NotFound |
|
|
|
The specified user is not a member of this thread. |
|
|
|
HTTPException |
|
|
|
Retrieving the member failed. |
|
|
|
|
|
|
|
Returns |
|
|
|
-------- |
|
|
|
:class:`ThreadMember` |
|
|
|
The thread member from the user ID. |
|
|
|
""" |
|
|
|
|
|
|
|
data = await self._state.http.get_thread_member(self.id, user_id) |
|
|
|
return ThreadMember(parent=self, data=data) |
|
|
|
|
|
|
|
async def fetch_members(self) -> List[ThreadMember]: |
|
|
|
"""|coro| |
|
|
|
|
|
|
|