Skip to content

Commit ecfce57

Browse files
committed
:3
1 parent f1b72af commit ecfce57

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/main/java/dev/plex/guild/GuildPrefix.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
public final class GuildPrefix
1717
{
18-
private static final Pattern TEXT = Pattern.compile("[A-Za-z0-9\\[\\]]*");
19-
private static final Pattern SHAPE = Pattern.compile("(?:[A-Za-z0-9\uFFFC]{1,5}|\\[[A-Za-z0-9\uFFFC]{1,5}\\])");
18+
private static final Pattern TEXT = Pattern.compile("[A-Za-z0-9:\\[\\]]*");
19+
private static final Pattern SHAPE = Pattern.compile("(?:[A-Za-z0-9:\uFFFC]{1,5}|\\[[A-Za-z0-9:\uFFFC]{1,5}\\])");
2020
private static final GuildPrefix EMPTY = new GuildPrefix(null, Component.empty(), null);
2121

2222
private final String text;
@@ -45,7 +45,7 @@ public static GuildPrefix parse(String input, Function<String, Component> parser
4545
Component safe = visual(parser.apply(input), visible);
4646
if (!SHAPE.matcher(visible).matches())
4747
{
48-
throw new IllegalArgumentException("Use 1-5 letters, digits, sprites or heads, with optional paired brackets");
48+
throw new IllegalArgumentException("Use 1-5 letters, digits, colons, sprites or heads, with optional paired brackets");
4949
}
5050
String key = visible.toString().replaceAll("[^A-Za-z0-9]", "").toUpperCase(Locale.ROOT);
5151
if (key.isEmpty())
@@ -61,7 +61,7 @@ private static Component visual(Component component, StringBuilder visible)
6161
{
6262
if (!TEXT.matcher(text.content()).matches())
6363
{
64-
throw new IllegalArgumentException("Guild prefix text supports ASCII letters, digits and square brackets only");
64+
throw new IllegalArgumentException("Guild prefix text supports ASCII letters, digits, colons and square brackets only");
6565
}
6666
visible.append(text.content());
6767
}

‎src/main/resources/messages.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ guildChatToggled: "<green>Guild chat is now <status>."
4848
# Prefix
4949
guildPrefixSet: "<green>Set the guild prefix to '<prefix><green>'."
5050
guildPrefixCleared: "<green>Cleared the guild prefix."
51-
guildPrefixHelp: "Use 1-5 letters (A-Z, a-z), digits (0-9), sprites or heads, with no spaces and at least one letter or digit. Add both square brackets or neither. Letters and digits must be unique across guilds, regardless of case. Styling does not count."
52-
guildPrefixInvalid: "<red>Use 1-5 letters (A-Z, a-z), digits (0-9), sprites or heads, with no spaces and at least one letter or digit. Add both square brackets or neither. Letters and digits must be unique across guilds, regardless of case. Colors and decorations do not count."
51+
guildPrefixHelp: "Use 1-5 letters (A-Z, a-z), digits (0-9), colons, sprites or heads, with no spaces and at least one letter or digit. Add both square brackets or neither. Letters and digits must be unique across guilds, regardless of case. Styling does not count."
52+
guildPrefixInvalid: "<red>Use 1-5 letters (A-Z, a-z), digits (0-9), colons, sprites or heads, with no spaces and at least one letter or digit. Add both square brackets or neither. Letters and digits must be unique across guilds, regardless of case. Colors and decorations do not count."
5353
guildPrefixTaken: "<red>That prefix is already taken. Choose different letters or digits. Brackets, styling, sprites, heads and letter case do not make a prefix unique."
5454

5555
# World

0 commit comments

Comments
 (0)