File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/main/java/org/mangorage/mangobotgithub Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments