diff --git a/melisa/models/guild/channel.py b/melisa/models/guild/channel.py index f92535c..3564c66 100644 --- a/melisa/models/guild/channel.py +++ b/melisa/models/guild/channel.py @@ -676,11 +676,42 @@ class Thread(MessageableChannel): HTTPException The request to perform the action failed with other http exception. ForbiddenError - You do not have permissions to add the user to the thread. + You do not have permissions to remove the user to the thread. """ await self._http.delete(f"channels/{self.id}/thread-members/{user_id}") + async def join(self) -> None: + """|coro| + + Joins this thread. + + You must have ``SEND_MESSAGES_IN_THREADS`` to join a thread. + If the thread is private, ``MANAGE_THREADS`` is also needed. + + Raises + ------- + HTTPException + The request to perform the action failed with other http exception. + ForbiddenError + You do not have permissions to join the thread. + """ + + await self._http.put(f"/channels/{self.id}/thread-members/@me") + + async def leave(self) -> None: + """|coro| + + Leaves this thread. + + Raises + ------- + HTTPException + The request to perform the action failed with other http exception. + """ + + await self._http.delete(f"/channels/{self.id}/thread-members/@me") + @dataclass(repr=False) class ThreadsList(APIModelBase):