fix quote plugin's handling of negative quote numbers

This commit is contained in:
Ryan Hitchman 2010-03-18 14:31:21 -06:00
parent 3e1755b564
commit 8a93c7f21b
1 changed files with 4 additions and 1 deletions

View File

@ -71,9 +71,12 @@ def quote(inp, nick='', chan='', db=None):
num = int(num)
if num:
if num > n_quotes:
if num > n_quotes or (num < 0 and num < -n_quotes):
return "I only have %d quote%s for %s" % (n_quotes,
('s', '')[n_quotes == 1], select)
elif num < 0:
selected_quote = quotes[num]
num = n_quotes + num + 1
else:
selected_quote = quotes[num - 1]
else: