Skip to content

Commit 99201a8

Browse files
authored
add java doc for config method and a typo fix (#956)
* add java doc for a config method and a typo fix for method name * improve added javadoc
1 parent 00e30ba commit 99201a8

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

application/src/main/java/org/togetherjava/tjbot/config/Config.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class Config {
4141
private final JShellConfig jshell;
4242
private final HelperPruneConfig helperPruneConfig;
4343
private final FeatureBlacklistConfig featureBlacklistConfig;
44-
private final String selectRolesChannelPatten;
44+
private final String selectRolesChannelPattern;
4545

4646
@SuppressWarnings("ConstructorWithTooManyParameters")
4747
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
@@ -85,7 +85,7 @@ private Config(@JsonProperty(value = "token", required = true) String token,
8585
@JsonProperty(value = "featureBlacklist",
8686
required = true) FeatureBlacklistConfig featureBlacklistConfig,
8787
@JsonProperty(value = "selectRolesChannelPattern",
88-
required = true) String selectRolesChannelPatten) {
88+
required = true) String selectRolesChannelPattern) {
8989
this.token = Objects.requireNonNull(token);
9090
this.gistApiKey = Objects.requireNonNull(gistApiKey);
9191
this.databasePath = Objects.requireNonNull(databasePath);
@@ -113,7 +113,7 @@ private Config(@JsonProperty(value = "token", required = true) String token,
113113
this.jshell = Objects.requireNonNull(jshell);
114114
this.helperPruneConfig = Objects.requireNonNull(helperPruneConfig);
115115
this.featureBlacklistConfig = Objects.requireNonNull(featureBlacklistConfig);
116-
this.selectRolesChannelPatten = Objects.requireNonNull(selectRolesChannelPatten);
116+
this.selectRolesChannelPattern = Objects.requireNonNull(selectRolesChannelPattern);
117117
}
118118

119119
/**
@@ -373,7 +373,13 @@ public FeatureBlacklistConfig getFeatureBlacklistConfig() {
373373
return featureBlacklistConfig;
374374
}
375375

376-
public String getSelectRolesChannelPatten() {
377-
return selectRolesChannelPatten;
376+
/**
377+
* Gets the REGEX pattern used to identify the channel in which users can select their helper
378+
* roles.
379+
*
380+
* @return the channel name pattern
381+
*/
382+
public String getSelectRolesChannelPattern() {
383+
return selectRolesChannelPattern;
378384
}
379385
}

application/src/main/java/org/togetherjava/tjbot/features/help/AutoPruneHelperRoutine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public AutoPruneHelperRoutine(Config config, HelpSystemHelper helper,
7070
inactiveAfter = Period.ofDays(helperPruneConfig.inactivateAfterDays());
7171
recentlyJoinedDays = helperPruneConfig.recentlyJoinedDays();
7272
selectYourRolesChannelNamePredicate =
73-
Pattern.compile(config.getSelectRolesChannelPatten()).asMatchPredicate();
73+
Pattern.compile(config.getSelectRolesChannelPattern()).asMatchPredicate();
7474
}
7575

7676
@Override

0 commit comments

Comments
 (0)