1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +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") print("@" + username + ": /roll")
cmd = text.split(' ', 1) cmd = text.split(' ', 1)
if len(cmd) >= 2: 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: else:
m = 100 m = 100
n = random.randrange(m) + 1 n = random.randrange(m) + 1