File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
src/main/java/net/discordjug/javabot Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,17 @@ public class HelpConfig extends GuildConfigItem {
116116 private double thankExperience = 3 ;
117117
118118 /**
119- * The amount that should be subtracted from every Help Account each day.
119+ * The minimum total amount of XP that should be subtracted from every Help Account each day.
120+ */
121+ private int minDailyExperienceSubtraction = 1 ;
122+
123+ /**
124+ * The maximum total amount of XP that should be subtracted from every Help Account each day.
125+ */
126+ private int maxDailyExperienceSubtraction = 50 ;
127+
128+ /**
129+ * The percentage of XP that should be subtracted from every Help Account each day.
120130 */
121131 private double dailyExperienceSubtraction = 5 ;
122132
Original file line number Diff line number Diff line change 22
33import lombok .RequiredArgsConstructor ;
44import net .discordjug .javabot .data .config .BotConfig ;
5+ import net .discordjug .javabot .data .config .guild .HelpConfig ;
56import net .discordjug .javabot .data .h2db .DbHelper ;
67import net .discordjug .javabot .systems .help .dao .HelpAccountRepository ;
78import net .discordjug .javabot .util .ExceptionLogger ;
@@ -31,9 +32,12 @@ public class HelpExperienceJob {
3132 public void execute () {
3233 asyncPool .execute (() -> {
3334 try {
35+ // just get the config for the first guild the bot is in, as it's not designed to work in multiple guilds anyway
36+ HelpConfig helpConfig = botConfig .get (jda .getGuilds ().get (0 )).getHelpConfig ();
3437 helpAccountRepository .removeExperienceFromAllAccounts (
35- // just get the config for the first guild the bot is in, as it's not designed to work in multiple guilds anyway
36- botConfig .get (jda .getGuilds ().get (0 )).getHelpConfig ().getDailyExperienceSubtraction (), 1 , 50 );
38+ helpConfig .getDailyExperienceSubtraction (),
39+ helpConfig .getMinDailyExperienceSubtraction (),
40+ helpConfig .getMaxDailyExperienceSubtraction ());
3741 } catch (DataAccessException e ) {
3842 ExceptionLogger .capture (e , DbHelper .class .getSimpleName ());
3943 }
You can’t perform that action at this time.
0 commit comments