From d3a680f0e98e8eecab9c4563106bce846e5b387c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 7 Oct 2015 10:49:14 +0200 Subject: [PATCH] forse no crash --- bot.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bot.py b/bot.py index 94636925..6e6c4fe7 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import telegram import steam @@ -8,17 +8,14 @@ while(True): msg = telegram.getUpdates() cmd = msg['text'].split(' ', 1) sby = msg['chat']['id'] + print(sby + ": " + repr(msg)) if(cmd[0].startswith('/ahnonlosoio')): - print('/ahnonlosoio') telegram.sendMessage("Ah, non lo so nemmeno io!", sby) elif(cmd[0].startswith('/ehoh')): - print('/ehoh') telegram.sendMessage("Eh, oh. Sono cose che capitano.", sby) elif(cmd[0].startswith('/start')): - print('/start') telegram.sendMessage("Ascolta, io mi starto quando mi pare. Anzi, quando Steffo ha voglia di aprirmi.", sby) elif(cmd[0].startswith('/playing')): - print('/playing ...') if(len(cmd) >= 2): n = steam.getNumberOfCurrentPlayers(cmd[1]) if(n == None): @@ -28,11 +25,9 @@ while(True): else: telegram.sendMessage(chr(9888) + " Non hai specificato un AppID!\nLa sintassi corretta è /playing .", sby) elif(cmd[0].startswith('/saldistim')): - print('/saldistim ...') if(len(cmd) >= 2): telegram.sendMessage("Ricerca di offerte di [" + cmd[1] + "](https://isthereanydeal.com/#/search:" + cmd[1].replace(' ', '%20') + ";/scroll:%23gamelist) completata.", sby) else: telegram.sendMessage(chr(9888) + " Non hai specificato un gioco! [Visualizza tutte le offerte](https://isthereanydeal.com/#/search:.;/scroll:%23gamelist).", sby) elif(cmd[0].startswith('/rage')): - print('/rage') - telegram.sendDocument("BQADAgAD3wEAAh8GgAE6ZnLP5_gFMwI", sby) \ No newline at end of file + telegram.sendDocument("BQADAgAD3wEAAh8GgAE6ZnLP5_gFMwI", sby)