mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-30 15:04:18 +00:00
Crashfix
This commit is contained in:
parent
6baa9a683a
commit
48a5aa65a2
1 changed files with 6 additions and 4 deletions
10
royalbot.py
10
royalbot.py
|
@ -117,10 +117,12 @@ while(True):
|
||||||
if(steam['response']['players']):
|
if(steam['response']['players']):
|
||||||
online = steam['response']['players'][0]['personastate']
|
online = steam['response']['players'][0]['personastate']
|
||||||
name = steam['response']['players'][0]['personaname']
|
name = steam['response']['players'][0]['personaname']
|
||||||
if(steam['response']['players'][0]['gameextrainfo']):
|
try:
|
||||||
ingame = steam['response']['players'][0]['gameextrainfo']
|
steam['response']['players'][0]['gameextrainfo'])
|
||||||
else:
|
except KeyError:
|
||||||
ingame = None
|
ingame = None
|
||||||
|
else:
|
||||||
|
ingame = steam['response']['players'][0]['gameextrainfo']
|
||||||
text = ""
|
text = ""
|
||||||
if(online == 0):
|
if(online == 0):
|
||||||
text = unichr(9898) + " Offline"
|
text = unichr(9898) + " Offline"
|
||||||
|
@ -136,7 +138,7 @@ while(True):
|
||||||
text = unichr(55357) + unichr(56629) + " Disponibile per scambiare"
|
text = unichr(55357) + unichr(56629) + " Disponibile per scambiare"
|
||||||
elif(online == 6):
|
elif(online == 6):
|
||||||
text = unichr(55357) + unichr(56629) + " Disponibile per giocare"
|
text = unichr(55357) + unichr(56629) + " Disponibile per giocare"
|
||||||
if ingame:
|
if ingame is not None:
|
||||||
sendMessage(name + " sta giocando a " + unichr(55357) + unichr(56628) + " " + ingame + ".", msg['chat']['id'])
|
sendMessage(name + " sta giocando a " + unichr(55357) + unichr(56628) + " " + ingame + ".", msg['chat']['id'])
|
||||||
else:
|
else:
|
||||||
sendMessage(name + " e' " + text + ".", msg['chat']['id'])
|
sendMessage(name + " e' " + text + ".", msg['chat']['id'])
|
||||||
|
|
Loading…
Reference in a new issue