Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
💬 fixed incorrect docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
darvil82 committed Dec 30, 2021
1 parent 64e6e0e commit e4156dd
Showing 1 changed file with 12 additions and 33 deletions.
45 changes: 12 additions & 33 deletions pincer/objects/guild/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,20 +842,15 @@ async def list_thread_members(self) -> AsyncIterator[ThreadMember]:
construct_client_dict(self._client, member)
)

async def list_active_threads(self) -> Dict[str, Any]:
async def list_active_threads(self) -> ThreadsResponse:
"""|coro|
Returns all active threads in the channel, including public and
private threads. Threads are ordered by their id, in descending order.
Returns
-------
Dict[:class:`str`, :class:`Any`]
Dictionary containing the response body:
- threads: Generator of the active threads.
- members: Generator for each thread member object for each
returned thread the current user has joined.
- has_more: Whether there are potentially additional threads
that could be returned on a subsequent call.
:class:`~pincer.objects.channel.ThreadsResponse`
The response object.
"""
return ThreadsResponse.from_dict(
construct_client_dict(
Expand All @@ -866,7 +861,7 @@ async def list_active_threads(self) -> Dict[str, Any]:

async def list_public_archived_threads(
self, before: Optional[Timestamp] = None, limit: Optional[int] = None
) -> Dict[str, Any]:
) -> ThreadsResponse:
"""|coro|
Returns archived threads in the channel that are public.
When called on a ``GUILD_TEXT`` channel, returns threads of type
Expand All @@ -886,13 +881,8 @@ async def list_public_archived_threads(
Returns
-------
Dict[:class:`str`, :class:`Any`]
Dictionary containing the response body:
- threads: Generator of the public archived threads.
- members: Generator for each thread member object for each
returned thread the current user has joined.
- has_more: Whether there are potentially additional threads
that could be returned on a subsequent call.
:class:`~pincer.objects.channel.ThreadsResponse`
The response object.
"""
data = await self._http.get(
f"channels/{self.id}/threads/archived/public",
Expand All @@ -904,7 +894,7 @@ async def list_public_archived_threads(

async def list_private_archived_threads(
self, before: Optional[Timestamp] = None, limit: Optional[int] = None
) -> Dict[str, Any]:
) -> ThreadsResponse:
"""|coro|
Returns archived threads in the channel that are of type
``GUILD_PRIVATE_THREAD``. Threads are ordered by ``archive_timestamp``,
Expand All @@ -922,13 +912,8 @@ async def list_private_archived_threads(
Returns
-------
Dict[:class:`str`, :class:`Any`]
Dictionary containing the response body:
- threads: Generator of the private archived threads.
- members: Generator for each thread member object for each
returned thread the current user has joined.
- has_more: Whether there are potentially additional threads
that could be returned on a subsequent call.
:class:`~pincer.objects.channel.ThreadsResponse`
The response object.
"""
data = await self._http.get(
f"channels/{self.id}/threads/archived/private",
Expand All @@ -940,7 +925,7 @@ async def list_private_archived_threads(

async def list_joined_private_archived_threads(
self, before: Optional[Timestamp] = None, limit: Optional[int] = None
) -> Dict[str, Any]:
) -> ThreadsResponse:
"""|coro|
Returns archived threads in the channel that are of type
``GUILD_PRIVATE_THREAD``, and the user has joined. Threads are ordered
Expand All @@ -958,14 +943,8 @@ async def list_joined_private_archived_threads(
Returns
-------
Dict[:class:`str`, :class:`Any`]
Dictionary containing the response body:
- threads: Generator of the private archived threads
the user has joined.
- members: Generator for each thread member object for each
returned thread the current user has joined.
- has_more: Whether there are potentially additional threads
that could be returned on a subsequent call.
:class:`~pincer.objects.channel.ThreadsResponse`
The response object.
"""
data = self._http.get(
f"channels/{self.id}/users/@me/threads/archived/private",
Expand Down

0 comments on commit e4156dd

Please sign in to comment.