aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar francisdbillones <[email protected]>2021-04-19 21:42:40 +0800
committerGravatar GitHub <[email protected]>2021-04-19 21:42:40 +0800
commit0204f7cc73bcf803fe86ca45cbdca19432b83cb6 (patch)
treeebadbfeae7dca0feb6def993f0fef2618dd73617
parentMerge pull request #1528 from python-discord/mbaruh/allow_eval (diff)
Fix zen's negative indexing
Negative indexing starts at -1, not 0, meaning lower bound should be -1 * len(zen_lines), not -1 * upper_bound.
-rw-r--r--bot/exts/utils/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/utils/utils.py b/bot/exts/utils/utils.py
index 8d9d27c64..4c39a7c2a 100644
--- a/bot/exts/utils/utils.py
+++ b/bot/exts/utils/utils.py
@@ -109,7 +109,7 @@ class Utils(Cog):
# handle if it's an index int
if isinstance(search_value, int):
upper_bound = len(zen_lines) - 1
- lower_bound = -1 * upper_bound
+ lower_bound = -1 * len(zen_lines)
if not (lower_bound <= search_value <= upper_bound):
raise BadArgument(f"Please provide an index between {lower_bound} and {upper_bound}.")