From f81d9034806d95640cc1745bd36330ce4c28b5eb Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Tue, 21 Jul 2015 17:40:44 +0200 Subject: [PATCH] dota2wins: allow finding steam ID by username --- i3pystatus/dota2wins.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/i3pystatus/dota2wins.py b/i3pystatus/dota2wins.py index fd7fc9e..a47880f 100644 --- a/i3pystatus/dota2wins.py +++ b/i3pystatus/dota2wins.py @@ -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: