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

Controllo errori durante /roll

This commit is contained in:
Steffo 2016-01-27 15:41:57 +01:00
parent 42bb2b380f
commit 819f44836a

5
bot.py
View file

@ -297,7 +297,10 @@ while True:
print("@" + username + ": /roll")
cmd = text.split(' ', 1)
if len(cmd) >= 2:
m = int(cmd[1])
try:
m = int(cmd[1])
except ValueError:
telegram.sendmessage(chr(9888) + " Il numero specificato non è un intero.")
else:
m = 100
n = random.randrange(m) + 1