diff --git a/README.rst b/README.rst index 42e2e58..b17870b 100644 --- a/README.rst +++ b/README.rst @@ -67,6 +67,7 @@ Supported API calls - get_league_listing - get_live_league_games - get_team_info_by_team_id +- get_team_info - get_heroes - get_tournament_prize_pool - get_game_items diff --git a/dota2api/__init__.py b/dota2api/__init__.py index 7ce85e2..d57f988 100644 --- a/dota2api/__init__.py +++ b/dota2api/__init__.py @@ -161,6 +161,20 @@ def get_team_info_by_team_id(self, start_at_team_id=None, **kwargs): if not self.__check_http_err(req.status_code): return response.build(req, url, self.raw_mode) + def get_team_info(self, team_id=None, **kwargs): + """Returns a team's info + + :param team_id: team's id + """ + if 'team_id' not in kwargs: + kwargs['team_id'] = team_id + url = self.__build_url(urls.GET_TEAM_INFO, **kwargs) + req = self.executor(url) + if self.logger: + self.logger.info('URL: {0}'.format(url)) + if not self.__check_http_err(req.status_code): + return response.build(req, url) + def get_player_summaries(self, steamids=None, **kwargs): """Returns a dictionary containing a player summaries diff --git a/dota2api/src/urls.py b/dota2api/src/urls.py index ed526c9..d6a1803 100644 --- a/dota2api/src/urls.py +++ b/dota2api/src/urls.py @@ -9,6 +9,7 @@ GET_LEAGUE_LISTING = "IDOTA2Match_570/GetLeagueListing/v0001/" GET_LIVE_LEAGUE_GAMES = "IDOTA2Match_570/GetLiveLeagueGames/v0001/" GET_TEAM_INFO_BY_TEAM_ID = "IDOTA2Match_570/GetTeamInfoByTeamID/v001/" +GET_TEAM_INFO = "IDOTA2Teams_570/GetTeamInfo/v001/" GET_PLAYER_SUMMARIES = "ISteamUser/GetPlayerSummaries/v0002/" GET_HEROES = "IEconDOTA2_570/GetHeroes/v0001/" GET_GAME_ITEMS = "IEconDOTA2_570/GetGameItems/v0001/"