Skip to content

Commit

Permalink
implement decline join request (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anupya committed Oct 20, 2023
1 parent 50d7882 commit c65d17c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Most of the API is available:
client.teams.kick_member
client.teams.get_join_requests
client.teams.accept_join_request
client.teams.decline_join_request
client.teams.get_team
client.teams.teams_of_player
client.teams.get_popular
Expand Down
9 changes: 9 additions & 0 deletions berserk/clients/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ def accept_join_request(self, team_id: str, user_id: str) -> None:
path = f"/api/team/{team_id}/request/{user_id}/accept"
self._r.post(path)

def decline_join_request(self, team_id: str, user_id: str) -> None:
"""Decline someone's request to join one of your teams
:param team_id: ID of the team to decline the request for
:param user_id: ID of the user requesting to join
"""
path = f"/api/team/{team_id}/request/{user_id}/decline"
self._r.post(path)

def get_team(self, team_id: str) -> Team:
"""Get the information about the team
Expand Down

0 comments on commit c65d17c

Please sign in to comment.