From 6d68dd7d10cc9de92a1c8e895952d85ee3984462 Mon Sep 17 00:00:00 2001 From: LeandroVandari Date: Tue, 18 Mar 2025 21:42:29 -0300 Subject: 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 --- bot/exts/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)}):" -- cgit v1.2.3