aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar vivekashok1221 <[email protected]>2024-05-23 19:45:13 +0400
committerGravatar vivekashok1221 <[email protected]>2024-05-23 19:45:13 +0400
commit77c62f40303bb497b300bf46644e1c771cf0f214 (patch)
treed0bec077c9475696e3618e4bbf31b6cf1515e7e1
parentDon't upload to pastebin when no truncation (diff)
Adjust truncation for 11 lines
-rw-r--r--bot/exts/utils/snekbox/_cog.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/exts/utils/snekbox/_cog.py b/bot/exts/utils/snekbox/_cog.py
index 71d36e141..33e38ba1b 100644
--- a/bot/exts/utils/snekbox/_cog.py
+++ b/bot/exts/utils/snekbox/_cog.py
@@ -272,7 +272,10 @@ class Snekbox(Cog):
if len(lines) > max_lines:
truncated = True
- lines = lines[:max_lines]
+ if len(lines) == max_lines + 1:
+ lines = lines[:max_lines - 1]
+ else:
+ lines = lines[:max_lines]
output = "\n".join(lines)
if len(output) >= max_chars:
output = f"{output[:max_chars]}\n... (truncated - too long, too many lines)"