impl channel create and delete logging

This commit is contained in:
Lee
2024-07-02 19:24:48 +01:00
parent 86c147f359
commit a3ffaf1ab9
7 changed files with 128 additions and 5 deletions

View File

@ -6,6 +6,8 @@ import cc.fascinated.bat.model.BatUser;
import cc.fascinated.bat.model.DiscordMessage;
import lombok.NonNull;
import lombok.extern.log4j.Log4j2;
import net.dv8tion.jda.api.events.channel.ChannelCreateEvent;
import net.dv8tion.jda.api.events.channel.ChannelDeleteEvent;
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;
@ -190,6 +192,7 @@ public class EventService extends ListenerAdapter {
}
}
@Override
public void onGuildMemberRoleRemove(@NotNull GuildMemberRoleRemoveEvent event) {
if (event.getUser().isBot()) {
return;
@ -201,4 +204,22 @@ public class EventService extends ListenerAdapter {
listener.onGuildMemberRoleRemove(guild, user, event.getRoles(), event);
}
}
@Override
public void onChannelCreate(@NotNull ChannelCreateEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onChannelCreate(guild, event);
}
}
@Override
public void onChannelDelete(@NotNull ChannelDeleteEvent event) {
BatGuild guild = guildService.getGuild(event.getGuild().getId());
for (EventListener listener : LISTENERS) {
listener.onChannelDelete(guild, event);
}
}
}