summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelSergey <sergey.ichtchenko@gmail.com>2016-05-31 17:34:49 +0300
committerPixelSergey <sergey.ichtchenko@gmail.com>2016-05-31 17:34:49 +0300
commit5d00af8cedae09b66a0569e03635a04b0b188a1e (patch)
tree72722e10de9e9f0250546f2f97ae3c845885d53a
parent1e34a9b39bcc78bbfd43579ac2a70e19f33b679b (diff)
Fix checking for page 0 in saylol.py listing
I hope I'm not making this too messy
-rw-r--r--saylol.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/saylol.py b/saylol.py
index 902e801..3fe2fe5 100644
--- a/saylol.py
+++ b/saylol.py
@@ -72,9 +72,11 @@ def on_lol_command(sender, command, label, args):
arg1 = args[1] if len(args) > 1 else None
if not arg1:
arg1 = "1"
- if not arg1.isdigit() or arg1 == "0":
+ if not arg1.isdigit():
msg(sender, "&cInvalid argument \"%s\"" % arg1)
return True
+ if int(arg1) == 0:
+ msg(sender, "&cPage 0 does not exist")
arg1 = int(arg1) - 1
offset = list_limit * arg1
if offset > len(lols):