impl voice join and leave logging

This commit is contained in:
Lee
2024-07-03 22:57:51 +01:00
parent 2b4980fb10
commit a7a7bc784b
4 changed files with 59 additions and 1 deletions

View File

@ -16,6 +16,7 @@ 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.guild.member.update.GuildMemberUpdateTimeOutEvent;
import net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent;
import net.dv8tion.jda.api.events.interaction.ModalInteractionEvent;
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
import net.dv8tion.jda.api.events.interaction.component.StringSelectInteractionEvent;
@ -290,4 +291,17 @@ public class EventService extends ListenerAdapter {
listener.onUserUpdateAvatar(user, event.getOldAvatarUrl(), event.getNewAvatarUrl(), event);
}
}
@Override
public void onGuildVoiceUpdate(@NotNull GuildVoiceUpdateEvent event) {
if (event.getEntity().getUser().isBot()) {
return;
}
BatGuild guild = guildService.getGuild(event.getEntity().getGuild().getId());
BatUser user = userService.getUser(event.getEntity().getUser().getId());
for (EventListener listener : LISTENERS) {
listener.onGuildVoiceUpdate(guild, user, event);
}
}
}