Skip to content

Commit ea8daeb

Browse files
committed
pattern fixes in config
1 parent ce21c31 commit ea8daeb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public final class Config {
4444
private final HelperPruneConfig helperPruneConfig;
4545
private final FeatureBlacklistConfig featureBlacklistConfig;
4646
private final String selectRolesChannelPattern;
47-
private final String memberCountCategoryName;
47+
private final String memberCountCategoryPattern;
4848

4949
@SuppressWarnings("ConstructorWithTooManyParameters")
5050
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
@@ -87,7 +87,7 @@ private Config(@JsonProperty(value = "token", required = true) String token,
8787
@JsonProperty(value = "openaiApiKey", required = true) String openaiApiKey,
8888
@JsonProperty(value = "sourceCodeBaseUrl", required = true) String sourceCodeBaseUrl,
8989
@JsonProperty(value = "jshell", required = true) JShellConfig jshell,
90-
@JsonProperty(value = "memberCountCategoryName") String memberCountCategoryName,
90+
@JsonProperty(value = "memberCountCategoryPattern") String memberCountCategoryPattern,
9191
@JsonProperty(value = "helperPruneConfig",
9292
required = true) HelperPruneConfig helperPruneConfig,
9393
@JsonProperty(value = "featureBlacklist",
@@ -98,7 +98,7 @@ private Config(@JsonProperty(value = "token", required = true) String token,
9898
this.githubApiKey = Objects.requireNonNull(githubApiKey);
9999
this.databasePath = Objects.requireNonNull(databasePath);
100100
this.projectWebsite = Objects.requireNonNull(projectWebsite);
101-
this.memberCountCategoryName = memberCountCategoryName;
101+
this.memberCountCategoryPattern = memberCountCategoryPattern;
102102
this.discordGuildInvite = Objects.requireNonNull(discordGuildInvite);
103103
this.modAuditLogChannelPattern = Objects.requireNonNull(modAuditLogChannelPattern);
104104
this.modMailChannelPattern = Objects.requireNonNull(modMailChannelPattern);
@@ -410,11 +410,11 @@ public String getSelectRolesChannelPattern() {
410410
}
411411

412412
/**
413-
* Gets the categories by this name to showcase the total member count of the server.
413+
* Gets the pattern matching the category that is used to display the total member count.
414414
*
415415
* @return the categories name types
416416
*/
417-
public String getMemberCountCategoryName() {
418-
return memberCountCategoryName;
417+
public String getMemberCountCategoryPattern() {
418+
return memberCountCategoryPattern;
419419
}
420420
}

application/src/main/java/org/togetherjava/tjbot/features/basic/MemberCountDisplayRoutine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class MemberCountDisplayRoutine implements Routine {
1515

1616

1717
public MemberCountDisplayRoutine(Config config) {
18-
wordsInCategory = Pattern.compile(config.getMemberCountCategoryName()).asMatchPredicate();
18+
wordsInCategory =
19+
Pattern.compile(config.getMemberCountCategoryPattern()).asMatchPredicate();
1920
}
2021

2122
private void updateCategoryName(Category category) {

0 commit comments

Comments
 (0)