File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
application/src/main/java/org/togetherjava/tjbot/commands/tags Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 9
9
import org .togetherjava .tjbot .commands .SlashCommandVisibility ;
10
10
import org .togetherjava .tjbot .commands .utils .MessageUtils ;
11
11
import org .slf4j .Logger ;
12
+
13
+ import java .util .Collection ;
12
14
import java .util .List ;
13
15
import java .util .Objects ;
16
+ import java .util .Set ;
14
17
import java .util .stream .Collectors ;
15
18
16
19
/**
30
33
public final class TagsCommand extends SlashCommandAdapter {
31
34
private final TagSystem tagSystem ;
32
35
private static final Logger logger = LoggerFactory .getLogger (TagsCommand .class );
36
+ private static final int MAX_TAGS_THRESHOLD_WARNING = 200 ;
33
37
34
38
/**
35
39
* Creates a new instance, using the given tag system as base.
@@ -44,17 +48,16 @@ public TagsCommand(TagSystem tagSystem) {
44
48
45
49
@ Override
46
50
public void onSlashCommand (@ NotNull SlashCommandEvent event ) {
47
- int MAX_TAGS_THRESHOLD_WARNING = 200 ;
48
- if (tagSystem . getAllIds () .size () > MAX_TAGS_THRESHOLD_WARNING ) {
51
+ Collection < String > tagIds = tagSystem . getAllIds () ;
52
+ if (tagIds .size () > MAX_TAGS_THRESHOLD_WARNING ) {
49
53
// TODO Implement the edge case
50
54
51
55
logger .warn (
52
56
"The amount of tags is very high and it might soon exceed the maximum character limit. The code should be adjusted to support this edge case soon." );
53
57
}
54
- String tagListText = tagSystem .getAllIds ()
55
- .stream ()
58
+ String tagListText = tagIds .stream ()
56
59
.sorted ()
57
- .map (tag -> "* " + tag )
60
+ .map (tag -> "\u2022 " + tag )
58
61
.collect (Collectors .joining ("\n " ));
59
62
60
63
event
You can’t perform that action at this time.
0 commit comments