diff --git a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java index 06ac076..0a82dde 100644 --- a/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java +++ b/src/main/java/cc/fascinated/bat/features/logging/LogFeature.java @@ -58,12 +58,15 @@ public class LogFeature extends Feature { if (content == null) { return "No content"; } - if (content.length() > 512) { + // More than 512 characters or is more than 4 lines + if (content.length() > 512 || content.chars().filter(ch -> ch == '\n').count() > 4) { return "*Content too long, [click here to view]("+PasteUtils.uploadPaste(content).getUrl()+")*"; } + // Less than or equal to 32 characters and no new lines if (content.length() <= 32 && !content.contains("\n")) { return "`%s`".formatted(content); } + // Everything else return "\n```\n%s\n```".formatted(content); } }