add check to see if the member is in the guild before logging some events
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m27s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m27s
This commit is contained in:
parent
d7916ad24a
commit
83250d2c08
@ -89,6 +89,7 @@ public class MemberListener implements EventListener {
|
||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||
if (batGuild == null) continue;
|
||||
if (!guild.isMember(user.getDiscordUser())) continue; // User is not in the guild
|
||||
|
||||
logFeature.sendLog(batGuild, LogType.MEMBER_GLOBAL_NAME_UPDATE, EmbedUtils.genericEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("Member Name Updated")
|
||||
@ -106,6 +107,7 @@ public class MemberListener implements EventListener {
|
||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||
if (batGuild == null) continue;
|
||||
if (!guild.isMember(user.getDiscordUser())) continue; // User is not in the guild
|
||||
|
||||
logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("Member Username Updated")
|
||||
@ -123,6 +125,7 @@ public class MemberListener implements EventListener {
|
||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||
if (batGuild == null) continue;
|
||||
if (!guild.isMember(user.getDiscordUser())) continue; // User is not in the guild
|
||||
|
||||
logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("Member Avatar Updated")
|
||||
|
Loading…
x
Reference in New Issue
Block a user