From a6726c5ba3e890cc7ccb06dfb25fb61968353e90 Mon Sep 17 00:00:00 2001 From: Ionite Date: Wed, 22 Feb 2023 15:42:37 -0500 Subject: Fix file text count comparison --- bot/exts/utils/snekbox/_cog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/exts/utils/snekbox/_cog.py b/bot/exts/utils/snekbox/_cog.py index f09725b20..f1f0fddd7 100644 --- a/bot/exts/utils/snekbox/_cog.py +++ b/bot/exts/utils/snekbox/_cog.py @@ -389,8 +389,8 @@ class Snekbox(Cog): budget_chars = MAX_OUTPUT_BLOCK_CHARS for file in text_files: file_text = file.content.decode("utf-8", errors="replace") or "[Empty]" - # Override to always allow 1 line and < 50 chars, since this is less than a link - if len(file_text) < 50 and file_text.count("\n") < 2: + # Override to always allow 1 line and <= 50 chars, since this is less than a link + if len(file_text) <= 50 and not file_text.count("\n"): msg += f"\n`{file.name}`\n```\n{file_text}\n```" # otherwise, use budget else: -- cgit v1.2.3