Skip to content

Commit

Permalink
log when author is not a member
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgeiss0702 committed Oct 3, 2024
1 parent 91823a2 commit 820630d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/us/ajg0702/bots/ajsupport/MessageListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ public void onMessageReceived(@NotNull MessageReceivedEvent e) {
.queue();
}

if(e.getMember() == null) return;
if(e.getMember() == null) {
bot.getLogger().warn("{} is not a member!", e.getAuthor().getName());
return;
}

MessageChannelUnion channel = e.getChannel();
long parent = channel instanceof ICategorizableChannel ? ((ICategorizableChannel) channel).getParentCategoryIdLong() : -1;
Expand Down Expand Up @@ -172,6 +175,8 @@ public void onMessageReceived(@NotNull MessageReceivedEvent e) {
"**You have been muted** because you ignored this warning before. In the future, do not ping aj.") + "\n" +
"-# This message is a warning for <@" + e.getAuthor().getId() + ">")
.queue();
} else {
bot.getLogger().info("Not warning due to distanceSinceLast of " + distanceSinceLast);
}
int timeoutSeconds = distanceSinceLast < WEEK_SECONDS ? 60 : 30;

Expand Down

0 comments on commit 820630d

Please sign in to comment.