Skip to content

Commit

Permalink
Add GroupChat.join() and GroupChat.leave()
Browse files Browse the repository at this point in the history
Add methods GroupChat.join() and GroupChat.Leave() for joining and
leaving teams and forums.
  • Loading branch information
tylertian123 committed Nov 2, 2020
1 parent 0e33571 commit d14ccca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pyryver/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,24 @@ async def delete(self) -> None:
"""
url = self.get_api_url()
await self._ryver._session.delete(url)

async def join(self) -> None:
"""
Join this forum/team as the current logged in user.
"""
await self._ryver._session.post(self.get_api_url("Team.Join()", format="json"))

async def leave(self) -> None:
"""
Leave this forum/team as the current logged in user.
.. note::
This is not the same as selecting "Close and keep closed" in the UI. With
this, the user will no longer show up in the members list of the forum/team,
whereas "Close and keep closed" will still keep the user in the forum/team and
only update the notification settings.
"""
await self._ryver._session.post(self.get_api_url("Team.Leave()", format="json"))


class Forum(GroupChat):
Expand Down

0 comments on commit d14ccca

Please sign in to comment.