dota2wins: allow finding steam ID by username

This commit is contained in:
Paul Bienkowski 2015-07-21 17:40:44 +02:00
parent e85425c8c6
commit f81d903480

View File

@ -42,6 +42,11 @@ class Dota2wins(IntervalModule):
def run(self):
api.set_api_key(self.steam_api_key)
if not isinstance(self.steamid, int):
# find by username
self.steamid = int(api.get_steam_id(self.steamid)['response']['steamid'])
hist = api.get_match_history(account_id=self.steamid)['result']
recent_matches = []
while len(recent_matches) < self.matches: