forked from Fascinated/Bat
update format for messages in logging
This commit is contained in:
parent
45bfae281e
commit
ee138cb5a9
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user