Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Decline Join Request API #49

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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