forked from Fascinated/Bat
impl role add/remove logging
This commit is contained in:
@ -8,6 +8,8 @@ import lombok.NonNull;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent;
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent;
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberRoleAddEvent;
|
||||
import net.dv8tion.jda.api.events.guild.member.GuildMemberRoleRemoveEvent;
|
||||
import net.dv8tion.jda.api.events.guild.member.update.GuildMemberUpdateNicknameEvent;
|
||||
import net.dv8tion.jda.api.events.interaction.ModalInteractionEvent;
|
||||
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
|
||||
@ -174,4 +176,29 @@ public class EventService extends ListenerAdapter {
|
||||
listener.onGuildMemberUpdateNickname(guild, user, event.getOldNickname(), event.getNewNickname(), event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuildMemberRoleAdd(@NotNull GuildMemberRoleAddEvent event) {
|
||||
if (event.getUser().isBot()) {
|
||||
return;
|
||||
}
|
||||
BatGuild guild = guildService.getGuild(event.getGuild().getId());
|
||||
BatUser user = userService.getUser(event.getUser().getId());
|
||||
|
||||
for (EventListener listener : LISTENERS) {
|
||||
listener.onGuildMemberRoleAdd(guild, user, event.getRoles(), event);
|
||||
}
|
||||
}
|
||||
|
||||
public void onGuildMemberRoleRemove(@NotNull GuildMemberRoleRemoveEvent event) {
|
||||
if (event.getUser().isBot()) {
|
||||
return;
|
||||
}
|
||||
BatGuild guild = guildService.getGuild(event.getGuild().getId());
|
||||
BatUser user = userService.getUser(event.getUser().getId());
|
||||
|
||||
for (EventListener listener : LISTENERS) {
|
||||
listener.onGuildMemberRoleRemove(guild, user, event.getRoles(), event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user