Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/4.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/wot.py19
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']