1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Un po' di output per vedere se sta funzionando.

E dei nuovi rage.
This commit is contained in:
Steffo 2015-11-08 18:08:42 +01:00
parent 43e1086cc9
commit ab5e67c697

9
bot.py
View file

@ -2,6 +2,7 @@
import telegram import telegram
import steam import steam
import random import random
import sys
#Playlist di /rage, si riempie quando è vuota #Playlist di /rage, si riempie quando è vuota
rage = [] rage = []
@ -13,12 +14,16 @@ while(True):
cmd = msg['text'].split(' ', 1) cmd = msg['text'].split(' ', 1)
sby = msg['chat']['id'] sby = msg['chat']['id']
if(cmd[0].startswith('/ahnonlosoio')): if(cmd[0].startswith('/ahnonlosoio')):
print(str(sby) + ": /ahnonlosoio")
telegram.sendMessage("Ah, non lo so nemmeno io!", sby) telegram.sendMessage("Ah, non lo so nemmeno io!", sby)
elif(cmd[0].startswith('/ehoh')): elif(cmd[0].startswith('/ehoh')):
print(str(sby) + ": /ehoh")
telegram.sendMessage("Eh, oh. Sono cose che capitano.", sby) telegram.sendMessage("Eh, oh. Sono cose che capitano.", sby)
elif(cmd[0].startswith('/start')): elif(cmd[0].startswith('/start')):
print(str(sby) + ": /start")
telegram.sendMessage("Ascolta, io mi starto quando mi pare. Anzi, quando Steffo ha voglia di aprirmi.", sby) telegram.sendMessage("Ascolta, io mi starto quando mi pare. Anzi, quando Steffo ha voglia di aprirmi.", sby)
elif(cmd[0].startswith('/playing')): elif(cmd[0].startswith('/playing')):
print(str(sby) + ": /playing")
if(len(cmd) >= 2): if(len(cmd) >= 2):
n = steam.getNumberOfCurrentPlayers(cmd[1]) n = steam.getNumberOfCurrentPlayers(cmd[1])
if(n == None): if(n == None):
@ -28,6 +33,7 @@ while(True):
else: else:
telegram.sendMessage(chr(9888) + " Non hai specificato un AppID!\nLa sintassi corretta è /playing <AppID>.", sby) telegram.sendMessage(chr(9888) + " Non hai specificato un AppID!\nLa sintassi corretta è /playing <AppID>.", sby)
elif(cmd[0].startswith('/saldistim')): elif(cmd[0].startswith('/saldistim')):
print(str(sby) + ": /saldistim")
if(len(cmd) >= 2): if(len(cmd) >= 2):
telegram.sendMessage("Ricerca di offerte di [" + cmd[1] + "](https://isthereanydeal.com/#/search:" + cmd[1].replace(' ', '%20') + ";/scroll:%23gamelist) completata.", sby) telegram.sendMessage("Ricerca di offerte di [" + cmd[1] + "](https://isthereanydeal.com/#/search:" + cmd[1].replace(' ', '%20') + ";/scroll:%23gamelist) completata.", sby)
else: else:
@ -35,7 +41,8 @@ while(True):
elif(cmd[0].startswith('/rage')): elif(cmd[0].startswith('/rage')):
if(len(rage) <= 0): if(len(rage) <= 0):
#Elenco degli audio disponibili #Elenco degli audio disponibili
rage = ['BQADAgAD3wEAAh8GgAE6ZnLP5_gFMwI', 'BQADAgAD5AEAAh8GgAGu0FpK_X2DuQI', 'BQADAgAD5gEAAh8GgAGvUTJ9meZixwI', 'BQADAgAD5wEAAh8GgAHJSoUnCr9WxwI'] rage = ['BQADAgADEgIAAh8GgAGyLs6mbzxpVAI','BQADAgADEwIAAh8GgAGrT-MlTymm5gI','BQADAgADEQIAAh8GgAH62SrNqgXB6AI','BQADAgADEAIAAh8GgAHTLEngwtqr_QI','BQADAgAD3wEAAh8GgAE6ZnLP5_gFMwI', 'BQADAgAD5AEAAh8GgAGu0FpK_X2DuQI', 'BQADAgAD5gEAAh8GgAGvUTJ9meZixwI', 'BQADAgAD5wEAAh8GgAHJSoUnCr9WxwI', 'BQADAgAD6QEAAh8GgAExL8N1AWkDjgI', 'BQADAgAD6wEAAh8GgAFtkzazUqUEtwI', 'BQADAgAD9AEAAh8GgAE427GcA8FCqQI', 'BQADAgADMgIAAh8GgAEpusE7OCOXYgI', 'BQADAgADMwIAAh8GgAFffavzkvOkKAI']
random.shuffle(rage) random.shuffle(rage)
ragesend = rage.pop() ragesend = rage.pop()
print(str(sby) + ": /rage " + ragesend)
telegram.sendDocument(ragesend, sby) telegram.sendDocument(ragesend, sby)