diff options
author | 2025-03-15 21:37:05 -0300 | |
---|---|---|
committer | 2025-03-15 21:37:05 -0300 | |
commit | 4d63449d0f7812339e55a72d7696f2e2313cfdbf (patch) | |
tree | 14d6930bde1a59dbe0af855dde509204651b7296 | |
parent | Added the possibility of slicing for the zen command (diff) |
Fixed off-by-one error, as the end index can be equal to the length of the zen
-rw-r--r-- | bot/exts/utils/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/utils/utils.py b/bot/exts/utils/utils.py index 45ebd137f..817d159b2 100644 --- a/bot/exts/utils/utils.py +++ b/bot/exts/utils/utils.py @@ -128,7 +128,7 @@ class Utils(Cog): end_index=int(match.group(2)[1:]) - if not ((lower_bound <= start_index <= upper_bound) and (lower_bound <= end_index <= upper_bound)): + if not ((lower_bound <= start_index <= upper_bound) and (lower_bound <= end_index <= len(zen_lines))): raise BadArgument(f"Please provide valid indices between {lower_bound} and {upper_bound}.") if not (start_index % len(zen_lines) < end_index % len(zen_lines)): raise BadArgument("The start index for the slice must be smaller than the end index.") |