forked from Fascinated/Bat
impl channel create and delete logging
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user