forked from Fascinated/Bat
add check to see if the member is in the guild before logging some events
This commit is contained in:
parent
d7916ad24a
commit
83250d2c08
@ -89,6 +89,7 @@ public class MemberListener implements EventListener {
|
|||||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||||
if (batGuild == null) continue;
|
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()
|
logFeature.sendLog(batGuild, LogType.MEMBER_GLOBAL_NAME_UPDATE, EmbedUtils.genericEmbed()
|
||||||
.setDescription(new EmbedDescriptionBuilder("Member Name Updated")
|
.setDescription(new EmbedDescriptionBuilder("Member Name Updated")
|
||||||
@ -106,6 +107,7 @@ public class MemberListener implements EventListener {
|
|||||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||||
if (batGuild == null) continue;
|
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()
|
logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed()
|
||||||
.setDescription(new EmbedDescriptionBuilder("Member Username Updated")
|
.setDescription(new EmbedDescriptionBuilder("Member Username Updated")
|
||||||
@ -123,6 +125,7 @@ public class MemberListener implements EventListener {
|
|||||||
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
for (Guild guild : DiscordService.JDA.getGuilds()) {
|
||||||
BatGuild batGuild = guildService.getGuild(guild.getId());
|
BatGuild batGuild = guildService.getGuild(guild.getId());
|
||||||
if (batGuild == null) continue;
|
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()
|
logFeature.sendLog(batGuild, LogType.MEMBER_USERNAME_UPDATE, EmbedUtils.genericEmbed()
|
||||||
.setDescription(new EmbedDescriptionBuilder("Member Avatar Updated")
|
.setDescription(new EmbedDescriptionBuilder("Member Avatar Updated")
|
||||||
|
Loading…
Reference in New Issue
Block a user