Skip to content

Commit 8a6cc5c

Browse files
committed
Enhanced the experience.
1 parent aee823c commit 8a6cc5c

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/main/java/org/mangorage/mangobotgithub/core/PasteRequestModule.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -175,40 +175,40 @@ public static void analyzeLog(Message message) {
175175
var builder = new StringBuilder();
176176
analyser.scanMessage(message, builder);
177177

178-
TaskScheduler.getExecutor().execute(() -> {
179-
for (Message.Attachment attachment : attachments) {
180-
try {
181-
byte[] bytes = getData(attachment.getProxy().download().get());
182-
if (bytes == null) continue;
183-
String content = new String(bytes, StandardCharsets.UTF_8);
184-
if (containsPrintableCharacters(content)) {
185-
analyser.readLog(builder, content);
186-
break;
187-
}
188-
} catch (InterruptedException | ExecutionException e) {
189-
throw new RuntimeException(e);
178+
179+
for (Message.Attachment attachment : attachments) {
180+
try {
181+
byte[] bytes = getData(attachment.getProxy().download().get());
182+
if (bytes == null) continue;
183+
String content = new String(bytes, StandardCharsets.UTF_8);
184+
if (containsPrintableCharacters(content)) {
185+
analyser.readLog(builder, content);
186+
break;
190187
}
188+
} catch (InterruptedException | ExecutionException e) {
189+
throw new RuntimeException(e);
191190
}
191+
}
192192

193-
// Handle Links in the actual message
194-
for (String extractUrl : extractUrls(message.getContentRaw())) {
195-
var log = LinkExtractorList.LIST.fetch(extractUrl);
196-
if (log != null)
197-
analyser.readLog(builder, log);
198-
}
193+
// Handle Links in the actual message
194+
for (String extractUrl : extractUrls(message.getContentRaw())) {
195+
var log = LinkExtractorList.LIST.fetch(extractUrl);
196+
if (log != null)
197+
analyser.readLog(builder, log);
198+
}
199199

200-
if (!builder.isEmpty()) {;
201-
String id;
202-
if (PluginManager.isLoaded("mangobotsite")) {
203-
try {
204-
id = MangoBotSiteIntegration.handleLogResult(builder);
205-
if (id != null) {
206-
message.reply("[[Log Analyzer](https://mangobot.mangorage.org/file?id=%s)]".formatted(id)).setSuppressEmbeds(true).mentionRepliedUser(false).queue();
207-
}
208-
} catch (IOException ignored) {}
209-
}
200+
if (!builder.isEmpty()) {;
201+
String id;
202+
if (PluginManager.isLoaded("mangobotsite")) {
203+
try {
204+
id = MangoBotSiteIntegration.handleLogResult(builder);
205+
if (id != null) {
206+
message.reply("[[Log Analyzer](https://mangobot.mangorage.org/file?id=%s)]".formatted(id)).setSuppressEmbeds(true).mentionRepliedUser(false).queue();
207+
}
208+
} catch (IOException ignored) {}
210209
}
211-
});
210+
}
211+
212212

213213
}
214214

0 commit comments

Comments
 (0)