fix? or no or mabe or idk

This commit is contained in:
ChomeNS
2023-06-02 21:11:41 +07:00
parent 6a1d83ecd9
commit 60ebbbc09d
2 changed files with 5 additions and 1 deletions

View File

@@ -285,6 +285,8 @@ public class DiscordPlugin {
"\n```"
, channelId
);
logMessages.clear();
}
});
@@ -298,6 +300,7 @@ public class DiscordPlugin {
final Map<String, Boolean> doneSendingInLogs = new HashMap<>();
public void sendMessage(String message, String channelId) {
if (message.length() > 32767) return;
synchronized (logMessages) {
if (!logMessages.containsKey(channelId)) {
logMessages.put(channelId, new StringBuilder());

View File

@@ -158,7 +158,8 @@ public class Logger {
logWriter.write("\n");
}
logWriter.write(getTimePrefix() + str.replaceAll("\\[(\\d+?)x](?=$|[\r\n])", "[/$1x]")); // the replaceAll will prevent conflicts with the duplicate counter
if (str.length() > 32767) logWriter.write("Message too big, not logging this message"); // should these stuff be hardcoded?
else logWriter.write(getTimePrefix() + str.replaceAll("\\[(\\d+?)x](?=$|[\r\n])", "[/$1x]")); // the replaceAll will prevent conflicts with the duplicate counter
logWriter.flush();
duplicateCounter = 1;