Skip to content

Commit 7c3794d

Browse files
DevSerendipityZabuzard
authored andcommitted
Adding the bullet point unicode character, and wrapping tagSystem.getAllIds() with a Collection
1 parent 2f82211 commit 7c3794d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/tags/TagsCommand.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
import org.togetherjava.tjbot.commands.SlashCommandVisibility;
1010
import org.togetherjava.tjbot.commands.utils.MessageUtils;
1111
import org.slf4j.Logger;
12+
13+
import java.util.Collection;
1214
import java.util.List;
1315
import java.util.Objects;
16+
import java.util.Set;
1417
import java.util.stream.Collectors;
1518

1619
/**
@@ -30,6 +33,7 @@
3033
public final class TagsCommand extends SlashCommandAdapter {
3134
private final TagSystem tagSystem;
3235
private static final Logger logger = LoggerFactory.getLogger(TagsCommand.class);
36+
private static final int MAX_TAGS_THRESHOLD_WARNING = 200;
3337

3438
/**
3539
* Creates a new instance, using the given tag system as base.
@@ -44,17 +48,16 @@ public TagsCommand(TagSystem tagSystem) {
4448

4549
@Override
4650
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) {
4953
// TODO Implement the edge case
5054

5155
logger.warn(
5256
"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.");
5357
}
54-
String tagListText = tagSystem.getAllIds()
55-
.stream()
58+
String tagListText = tagIds.stream()
5659
.sorted()
57-
.map(tag -> "* " + tag)
60+
.map(tag -> "\u2022 " + tag)
5861
.collect(Collectors.joining("\n"));
5962

6063
event

0 commit comments

Comments
 (0)