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
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 44s
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user