Compare commits

...

2 Commits

Author SHA1 Message Date
6fef1d0092 check feature states
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 1m8s
2024-07-06 06:26:33 +01:00
f7aba7a49b lower retry limit 2024-07-06 06:24:53 +01:00
4 changed files with 7 additions and 3 deletions

View File

@ -19,7 +19,7 @@ public class ChannelUtils {
* @return the user with the given id
*/
private static TextChannel getTextChannel(String id, int retries) {
if (retries >= 25) {
if (retries >= 10) {
log.error("Failed to find user \"{}\" after {} retries.", id, retries);
return null;
}

View File

@ -19,7 +19,7 @@ public class UserUtils {
* @return the user with the given id
*/
private static User getUser(String id, int retries) {
if (retries >= 25) {
if (retries >= 10) {
log.error("Failed to find user \"{}\" after {} retries.", id, retries);
return null;
}

View File

@ -36,7 +36,7 @@ public class BirthdayFeature extends Feature implements EventListener {
private void checkBirthdays() {
for (Guild guild : DiscordService.JDA.getGuilds()) {
BatGuild batGuild = guildService.getGuild(guild.getId());
if (batGuild == null) {
if (batGuild.getFeatureProfile().isFeatureDisabled(this)) { // Check if the feature is disabled
continue;
}
BirthdayProfile profile = batGuild.getBirthdayProfile();

View File

@ -38,6 +38,10 @@ public class MinecraftFeature extends Feature {
public void checkServers() {
for (Guild guild : DiscordService.JDA.getGuilds()) {
BatGuild batGuild = guildService.getGuild(guild.getId());
if (batGuild.getFeatureProfile().isFeatureDisabled(this)) { // Check if the feature is disabled
continue;
}
batGuild.getMinecraftProfile().checkServers();
}
}