5
5
6
6
import java .util .List ;
7
7
import java .util .Objects ;
8
+ import java .util .regex .Pattern ;
8
9
9
10
/**
10
11
* Starboard Config
11
12
*
12
13
* @param emojiNames the List of emojis which are recognized by the starboard
13
- * @param channelName the name of the channel with the starboard
14
+ * @param channelPattern the pattern of the channel with the starboard
14
15
*/
15
16
@ JsonRootName ("starboard" )
16
- public record StarboardConfig (List <String > emojiNames , String channelName ) {
17
+ public record StarboardConfig (List <String > emojiNames , Pattern channelPattern ) {
17
18
/**
18
19
* Creates a Starboard config.
19
20
*
20
21
* @param emojiNames the List of emojis which are recognized by the starboard
21
- * @param channelName the name of the channel with the starboard
22
+ * @param channelPattern the pattern of the channel with the starboard
22
23
*/
23
24
@ JsonCreator (mode = JsonCreator .Mode .PROPERTIES )
24
25
public StarboardConfig {
25
26
Objects .requireNonNull (emojiNames );
26
- Objects .requireNonNull (channelName );
27
+ Objects .requireNonNull (channelPattern );
27
28
}
28
29
29
30
/**
30
31
* Gets the list of emotes that are recognized by the starboard feature. A message that is
31
32
* reacted on with an emote in this list will be reposted in a special channel
32
- * {@link #channelName ()}.
33
+ * {@link #channelPattern ()}.
33
34
* <p>
34
35
* Empty to deactivate the feature.
35
36
*
@@ -41,13 +42,12 @@ public List<String> emojiNames() {
41
42
}
42
43
43
44
/**
44
- * Gets the name of the channel with the starboard. Deactivate by using a non-existent channel
45
- * name.
45
+ * Gets the pattern of the channel with the starboard. Deactivate by using a non-existent
46
+ * channel name.
46
47
*
47
- * @return the name of the channel with the starboard
48
+ * @return the pattern of the channel with the starboard
48
49
*/
49
- @ Override
50
- public String channelName () {
51
- return channelName ;
50
+ public Pattern channelPattern () {
51
+ return channelPattern ;
52
52
}
53
53
}
0 commit comments