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:
parent
42bb2b380f
commit
819f44836a
1 changed files with 4 additions and 1 deletions
3
bot.py
3
bot.py
|
@ -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:
|
||||||
|
try:
|
||||||
m = int(cmd[1])
|
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
|
||||||
|
|
Loading…
Reference in a new issue