1717public final class ScamBlockerConfig {
1818 private final Mode mode ;
1919 private final String reportChannelPattern ;
20+ private final String botTrapChannelPattern ;
2021 private final Set <String > suspiciousKeywords ;
2122 private final Set <String > hostWhitelist ;
2223 private final Set <String > hostBlacklist ;
@@ -27,6 +28,8 @@ public final class ScamBlockerConfig {
2728 private ScamBlockerConfig (@ JsonProperty (value = "mode" , required = true ) Mode mode ,
2829 @ JsonProperty (value = "reportChannelPattern" ,
2930 required = true ) String reportChannelPattern ,
31+ @ JsonProperty (value = "botTrapChannelPattern" ,
32+ required = true ) String botTrapChannelPattern ,
3033 @ JsonProperty (value = "suspiciousKeywords" ,
3134 required = true ) Set <String > suspiciousKeywords ,
3235 @ JsonProperty (value = "hostWhitelist" , required = true ) Set <String > hostWhitelist ,
@@ -37,6 +40,7 @@ private ScamBlockerConfig(@JsonProperty(value = "mode", required = true) Mode mo
3740 required = true ) int isHostSimilarToKeywordDistanceThreshold ) {
3841 this .mode = Objects .requireNonNull (mode );
3942 this .reportChannelPattern = Objects .requireNonNull (reportChannelPattern );
43+ this .botTrapChannelPattern = Objects .requireNonNull (botTrapChannelPattern );
4044 this .suspiciousKeywords = new HashSet <>(Objects .requireNonNull (suspiciousKeywords ));
4145 this .hostWhitelist = new HashSet <>(Objects .requireNonNull (hostWhitelist ));
4246 this .hostBlacklist = new HashSet <>(Objects .requireNonNull (hostBlacklist ));
@@ -63,6 +67,16 @@ public String getReportChannelPattern() {
6367 return reportChannelPattern ;
6468 }
6569
70+ /**
71+ * Gets the REGEX pattern used to identify the channel that is used to as bot-trap. Sending
72+ * messages in this channel identifies the author as bot.
73+ *
74+ * @return the channel name pattern
75+ */
76+ public String getBotTrapChannelPattern () {
77+ return botTrapChannelPattern ;
78+ }
79+
6680 /**
6781 * Gets the set of keywords that are considered suspicious if they appear in a message.
6882 *
0 commit comments