diff options
author | 2023-02-22 15:42:37 -0500 | |
---|---|---|
committer | 2023-02-22 15:42:37 -0500 | |
commit | a6726c5ba3e890cc7ccb06dfb25fb61968353e90 (patch) | |
tree | c5bf8ffaa4a373192ca7ac894d24a8ddd9f943e4 | |
parent | Refactor format_output to have `output_default` as str (diff) |
Fix file text count comparison
-rw-r--r-- | bot/exts/utils/snekbox/_cog.py | 4 |
1 files 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: |