Skip to content

Commit 047ed86

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

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public static void analyzeLog(Message message) {
192192

193193
// Handle Links in the actual message
194194
for (String extractUrl : extractUrls(message.getContentRaw())) {
195+
System.out.println(extractUrl);
195196
var log = LinkExtractorList.LIST.fetch(extractUrl);
196197
if (log != null)
197198
analyser.readLog(builder, log);
@@ -215,18 +216,23 @@ public static void analyzeLog(Message message) {
215216
public static void onMessage(DiscordEvent<MessageReceivedEvent> event) {
216217
var discordEvent = event.getInstance();
217218
var message = discordEvent.getMessage();
219+
var analyze = false;
218220

219221
if (message.getAuthor().isBot()) return;
220222
if (message.getAuthor().isSystem()) return;
221223

222224

223225
if (message.getContentRaw().contains("https://")) {
224-
message.addReaction(ANALYZE).queue();
226+
analyze = true;
225227
}
226228

227229
if (!message.getAttachments().isEmpty()) {
228230
message.addReaction(CREATE_GISTS).queue();
231+
analyze = true;
229232
}
233+
234+
if (analyze)
235+
message.addReaction(ANALYZE).queue();
230236
}
231237

232238
public static void onReact(DiscordEvent<MessageReactionAddEvent> event) {

src/main/java/org/mangorage/mangobotgithub/link/extractors/GnomebotExtractor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static String fetchData(String urlString) {
3333
while ((line = reader.readLine()) != null) {
3434
result.append(line).append("\n");
3535
}
36+
} catch (IOException e) {
37+
e.printStackTrace();
3638
}
3739

3840
} catch (IOException e) {

0 commit comments

Comments
 (0)