big ass refactor to handle loading guilds and users without spring to make it more futureproof
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 44s

This commit is contained in:
Lee
2024-07-01 01:12:32 +01:00
parent f566c3bcb5
commit d372c41c98
58 changed files with 755 additions and 638 deletions

View File

@ -31,9 +31,8 @@ public class BirthdayFeature extends Feature implements EventListener {
@Override
public void onGuildMemberLeave(@NonNull BatGuild guild, @NonNull BatUser user, @NonNull GuildMemberRemoveEvent event) {
BirthdayProfile profile = guild.getProfile(BirthdayProfile.class);
BirthdayProfile profile = guild.getBirthdayProfile();
profile.removeBirthday(user.getId());
guildService.saveGuild(guild);
}
/**
@ -41,8 +40,8 @@ public class BirthdayFeature extends Feature implements EventListener {
*/
@Scheduled(cron = "0 1 0 * * *")
private void checkBirthdays() {
for (BatGuild guild : guildService.getAllGuilds()) {
BirthdayProfile profile = guild.getProfile(BirthdayProfile.class);
for (BatGuild guild : guildService.getGuilds().values()) {
BirthdayProfile profile = guild.getBirthdayProfile();
profile.checkBirthdays(guild);
}
}