Skip to content

Commit c6ad144

Browse files
committed
use java codeblock when autoformatting code in help channels
1 parent 86931fd commit c6ad144

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/net/discordjug/javabot/systems/help/AutoCodeFormatter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ private void sendFormatHint(MessageReceivedEvent event) {
131131
private void replaceUnformattedCode(String msg, int codeStartIndex, int codeEndIndex, MessageReceivedEvent event) {
132132
// default case: a "normal", non-ping containing, non first message of a forum-thread containing "{" and "}".
133133
// user must also have set their preferences to allow this.
134-
if (msg.length() > 1992) { // can't exceed discord's char limit
134+
if (msg.length() > 1988) { // can't exceed discord's char limit
135135
sendFormatHint(event);
136136
return;
137137
}
138-
String messageContent = msg.substring(0, codeStartIndex) + " ```" +
138+
String messageContent = msg.substring(0, codeStartIndex) + " ```java" +
139139
msg.substring(codeStartIndex, codeEndIndex) + " ```" + msg.substring(codeEndIndex);
140140
EmbedBuilder autoformatInfo = new EmbedBuilder().setDescription(botConfig.get(event.getGuild())
141141
.getHelpConfig()

0 commit comments

Comments
 (0)