Skip to content

Commit

Permalink
Merge pull request #3 from dignissimus/get-tournament-info
Browse files Browse the repository at this point in the history
Add get_tournament() method to get information about a tournament
  • Loading branch information
ZackClements authored Apr 9, 2021
2 parents 50a3379 + 642db76 commit 7f1dec2
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 @@ -124,6 +124,7 @@ Most if not all of the API is available:
client.bots.decline_challenge
client.tournaments.get
client.tournaments.get_tournament
client.tournaments.create_arena
client.tournaments.create_swiss
client.tournaments.export_arena_games
Expand Down
9 changes: 9 additions & 0 deletions berserk/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,15 @@ def get(self):
"""
path = 'api/tournament'
return self._r.get(path, converter=models.Tournaments.convert_values)

def get_tournament(self, tournament_id, page=1):
"""Get information about a tournament.
:patam str tournament_id
:return: tournament information
:rtype: dict
"""
path = f'api/tournament/{tournament_id}?page={page}'
return self._r.get(path, converter=models.Tournaments.convert_values)

@deprecated(version='0.11.0', reason='use Tournaments.create_arena or Tournaments.create_swiss instead')
def create(self, clock_time, clock_increment, minutes, name=None,
Expand Down

0 comments on commit 7f1dec2

Please sign in to comment.