add role create, delete, rename and update permissions logs

This commit is contained in:
Lee
2024-07-04 09:56:06 +01:00
parent c284bb8a7f
commit 6ba802912f
5 changed files with 141 additions and 3 deletions

View File

@ -31,6 +31,10 @@ import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
import net.dv8tion.jda.api.events.interaction.component.StringSelectInteractionEvent;
import net.dv8tion.jda.api.events.message.MessageDeleteEvent;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.events.role.RoleCreateEvent;
import net.dv8tion.jda.api.events.role.RoleDeleteEvent;
import net.dv8tion.jda.api.events.role.update.RoleUpdateNameEvent;
import net.dv8tion.jda.api.events.role.update.RoleUpdatePermissionsEvent;
import net.dv8tion.jda.api.events.user.update.UserUpdateAvatarEvent;
import net.dv8tion.jda.api.events.user.update.UserUpdateGlobalNameEvent;
import net.dv8tion.jda.api.events.user.update.UserUpdateNameEvent;
@ -401,4 +405,40 @@ public class EventService extends ListenerAdapter {
listener.onPermissionOverride(guild, event);
}
}
@Override
public void onRoleUpdatePermissions(@NotNull RoleUpdatePermissionsEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onRoleUpdatePermissions(guild, event);
}
}
@Override
public void onRoleCreate(@NotNull RoleCreateEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onRoleCreate(guild, event);
}
}
@Override
public void onRoleDelete(@NotNull RoleDeleteEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onRoleDelete(guild, event);
}
}
@Override
public void onRoleUpdateName(@NotNull RoleUpdateNameEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onRoleUpdateName(guild, event);
}
}
}