upd: WoT plugin - added info about last visit
This commit is contained in:
@@ -61,7 +61,7 @@ def wot(type, jid, nick, text):
|
||||
|
||||
vdata = wot_api.fetch('wot/tanks/stats', 'account_id=%s' % player_id)
|
||||
|
||||
pdata = wot_api.fetch('wot/account/info', 'account_id=%s&fields=nickname,statistics,global_rating' % player_id)
|
||||
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)
|
||||
@@ -114,7 +114,7 @@ def wot(type, jid, nick, text):
|
||||
msg = '%s: %s/%s' % (wotname, wins, battles)
|
||||
|
||||
else:
|
||||
try:
|
||||
if 1: #try:
|
||||
win_percent = round(100.0 * wins / battles, 2)
|
||||
msg = '%s: %s/%s (%s%%)' % (wotname, wins, battles, win_percent)
|
||||
|
||||
@@ -219,9 +219,12 @@ def wot(type, jid, nick, text):
|
||||
msg += L(' - master deerhead','%s/%s'%(jid,nick))
|
||||
except:
|
||||
pass
|
||||
|
||||
except:
|
||||
msg = L('Impossible to get statistics','%s/%s'%(jid,nick))
|
||||
msg += L('\nLast seen:','%s/%s'%(jid,nick))
|
||||
msg = L('%s\n- in battle: %s','%s/%s'%(jid,nick)) % (msg, datetime.datetime.fromtimestamp(pdata[player_id]['last_battle_time']))
|
||||
msg = L('%s\n- online: %s','%s/%s'%(jid,nick)) % (msg, datetime.datetime.fromtimestamp(pdata[player_id]['logout_at']))
|
||||
|
||||
#except:
|
||||
# msg = L('Impossible to get statistics','%s/%s'%(jid,nick))
|
||||
elif not pdata['status']:
|
||||
msg = L('Query error','%s/%s'%(jid,nick))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user