aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar LeandroVandari <[email protected]>2025-03-18 21:42:29 -0300
committerGravatar LeandroVandari <[email protected]>2025-03-18 21:42:29 -0300
commit6d68dd7d10cc9de92a1c8e895952d85ee3984462 (patch)
tree5e3639daf4385843dd0354741a8347c6ed156969
parentAdded support for negative signs and replaced re.search by re.match (diff)
Allows for end_index == len(zen_lines). Previously, in that case, end_index % zen_lines would be 0, even though it's the last line
-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 29db374b4..473d860d0 100644
--- a/bot/exts/utils/utils.py
+++ b/bot/exts/utils/utils.py
@@ -130,7 +130,7 @@ class Utils(Cog):
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)):
+ if not (start_index % len(zen_lines) < end_index % (len(zen_lines) + 1)):
raise BadArgument("The start index for the slice must be smaller than the end index.")
embed.title += f" (lines {start_index%len(zen_lines)}-{end_index%len(zen_lines)}):"