impl member avatar update logging

This commit is contained in:
Lee
2024-07-02 21:05:20 +01:00
parent ff23ea1d6c
commit 68a9a6dc48
4 changed files with 43 additions and 0 deletions

View File

@ -21,6 +21,7 @@ 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.user.update.UserUpdateAvatarEvent;
import net.dv8tion.jda.api.events.user.update.UserUpdateGlobalNameEvent;
import net.dv8tion.jda.api.events.user.update.UserUpdateNameEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
@ -277,4 +278,16 @@ public class EventService extends ListenerAdapter {
listener.onUserUpdateName(user, event.getOldName(), event.getNewName(), event);
}
}
@Override
public void onUserUpdateAvatar(@NotNull UserUpdateAvatarEvent event) {
if (event.getUser().isBot()) {
return;
}
BatUser user = userService.getUser(event.getUser().getId());
for (EventListener listener : LISTENERS) {
listener.onUserUpdateAvatar(user, event.getOldAvatarUrl(), event.getNewAvatarUrl(), event);
}
}
}