17
17
public final class ScamBlockerConfig {
18
18
private final Mode mode ;
19
19
private final String reportChannelPattern ;
20
+ private final String botTrapChannelPattern ;
20
21
private final Set <String > suspiciousKeywords ;
21
22
private final Set <String > hostWhitelist ;
22
23
private final Set <String > hostBlacklist ;
@@ -27,6 +28,8 @@ public final class ScamBlockerConfig {
27
28
private ScamBlockerConfig (@ JsonProperty (value = "mode" , required = true ) Mode mode ,
28
29
@ JsonProperty (value = "reportChannelPattern" ,
29
30
required = true ) String reportChannelPattern ,
31
+ @ JsonProperty (value = "botTrapChannelPattern" ,
32
+ required = true ) String botTrapChannelPattern ,
30
33
@ JsonProperty (value = "suspiciousKeywords" ,
31
34
required = true ) Set <String > suspiciousKeywords ,
32
35
@ JsonProperty (value = "hostWhitelist" , required = true ) Set <String > hostWhitelist ,
@@ -37,6 +40,7 @@ private ScamBlockerConfig(@JsonProperty(value = "mode", required = true) Mode mo
37
40
required = true ) int isHostSimilarToKeywordDistanceThreshold ) {
38
41
this .mode = Objects .requireNonNull (mode );
39
42
this .reportChannelPattern = Objects .requireNonNull (reportChannelPattern );
43
+ this .botTrapChannelPattern = Objects .requireNonNull (botTrapChannelPattern );
40
44
this .suspiciousKeywords = new HashSet <>(Objects .requireNonNull (suspiciousKeywords ));
41
45
this .hostWhitelist = new HashSet <>(Objects .requireNonNull (hostWhitelist ));
42
46
this .hostBlacklist = new HashSet <>(Objects .requireNonNull (hostBlacklist ));
@@ -63,6 +67,16 @@ public String getReportChannelPattern() {
63
67
return reportChannelPattern ;
64
68
}
65
69
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
+
66
80
/**
67
81
* Gets the set of keywords that are considered suspicious if they appear in a message.
68
82
*
0 commit comments