From ab70c75b074a158e81e4cbbb55d51c6fabb0dd82 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 7 Aug 2015 17:00:08 +0200 Subject: [PATCH] Nuovo comando, /steam steamid --- royalbot.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/royalbot.py b/royalbot.py index f8230c42..e327f10a 100644 --- a/royalbot.py +++ b/royalbot.py @@ -79,4 +79,22 @@ while(True): if(msg['text'] == "/steam") sendMessage("Specifica lo steamid della persona di cui vuoi specificare lo stato. Tag di telegram coming soon!", msg['chat']['id']) else: - getSteamStatus(msg['text'][7:]) \ No newline at end of file + steam = getSteamStatus(msg['text'][7:]) + online = steam['response']['players'][0]['personastate'] + name = steam['response']['players'][0]['personaname'] + text = "" + if(online == 0): + text = "Offline" + elif(online == 1): + text = "Online" + elif(online == 2): + text = "Occupato" + elif(online == 3): + text = "Assente" + elif(online == 4): + text = "Inattivo" + elif(online == 5): + text = "Disponibile per scambiare" + elif(online == 6): + text = "Disponibile per giocare" + sendMessage(name + " รจ " + text + ".") \ No newline at end of file