diff options
author | VitaliyS <VitaliyS@users.noreply.github.com> | 2015-09-13 09:32:55 +0300 |
---|---|---|
committer | VitaliyS <VitaliyS@users.noreply.github.com> | 2015-09-13 09:32:55 +0300 |
commit | fb3094b986293c8d3f130f147c5b763de7665e1b (patch) | |
tree | 6ffe718513b2c461a5748796e3b5a09956e00f7d | |
parent | 302b337ef2110fd4ab72dcf8d7f04baf1104a3f4 (diff) | |
parent | 453dd95b0dfc8f2f32926bf5d2f4aed3699100a7 (diff) |
Merge pull request #3 from turbosnail/master
fix: wot api requests
-rw-r--r-- | plugins/wot.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/wot.py b/plugins/wot.py index da0fd9b..c24e78a 100644 --- a/plugins/wot.py +++ b/plugins/wot.py @@ -75,12 +75,12 @@ def wot(type, jid, nick, text): pdata = wot_api.fetch('wot/account/info', 'account_id=%s&fields=nickname,statistics,global_rating,last_battle_time,logout_at' % player_id) stat = pdata[player_id]['statistics'] - claninfo = wot_api.fetch('wot/clan/membersinfo', 'member_id=%s' % player_id) + claninfo = wot_api.fetch('wgn/clans/membersinfo', 'account_id=%s' % player_id) if claninfo[player_id]: - clan_id = str(claninfo[player_id]['clan_id']) - cdata = wot_api.fetch('wot/clan/info', 'clan_id=%s&fields=abbreviation' % clan_id) - cname = cdata[clan_id]['abbreviation'] + clan_id = str(claninfo[player_id]['clan']['clan_id']) + cdata = wot_api.fetch('wgn/clans/info', 'clan_id=%s&fields=tag' % clan_id) + cname = cdata[clan_id]['tag'] except: pdata = None @@ -334,18 +334,17 @@ def wotclan(type, jid, nick, text): text = text.strip().upper() if text: try: - data = wot_api.fetch('wot/clan/list/', 'search=%s' % text) - claninfo = [i for i in data if i['abbreviation'] == text] + data = wot_api.fetch('wgn/clans/list/', 'search=%s' % text) + claninfo = [i for i in data if i['tag'] == text] if claninfo: claninfo = claninfo[0] clid = claninfo['clan_id'] - owner = claninfo['owner_name'] created_at = claninfo['created_at'] - abbrev = claninfo['abbreviation'] - data = wot_api.fetch('wot/clan/info/', 'clan_id=%s' % clid) + abbrev = claninfo['tag'] + data = wot_api.fetch('wgn/clans/info/', 'clan_id=%s' % clid) claninfo2 = data[str(clid)] msg = L('Name: %s [%s]','%s/%s'%(jid,nick)) % (claninfo2['name'], abbrev) - msg += L('\nOwner: %s','%s/%s'%(jid,nick)) % owner + msg += L('\nOwner: %s','%s/%s'%(jid,nick)) % claninfo2['creator_name'] msg += L('\nCreated at: %s','%s/%s'%(jid,nick)) % time.ctime(created_at) msg += L('\nCount of members: %s','%s/%s'%(jid,nick)) % claninfo2['members_count'] msg += L('\nMotto: %s','%s/%s'%(jid,nick)) % claninfo2['motto'] |