update format for messages in logging

This commit is contained in:
Lee 2024-07-04 07:49:35 +01:00
parent 45bfae281e
commit ee138cb5a9

View File

@ -56,6 +56,15 @@ public class LogFeature extends Feature {
* @return the formatted content
*/
public String formatContent(String content) {
return content.length() > 512 ? PasteUtils.uploadPaste(content).getUrl() : "\n```\n%s\n```".formatted(content);
if (content == null) {
return "No content";
}
if (content.length() > 512) {
return "Content too long, [click here to view]("+PasteUtils.uploadPaste(content)+")";
}
if (content.length() <= 32) {
return "`%s`".formatted(content);
}
return "\n```\n%s\n```".formatted(content);
}
}