mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Require MessageType's start with a letter
May cause issues with YML serialization as it can get finicky with keys starting with numbers.
This commit is contained in:
parent
f1d7e50dc0
commit
17e026f9aa
1 changed files with 2 additions and 2 deletions
|
@ -212,8 +212,8 @@ public class JDADiscordService implements DiscordService {
|
|||
|
||||
@Override
|
||||
public void registerMessageType(Plugin plugin, MessageType type) {
|
||||
if (!type.getKey().matches("^[a-z0-9-]*$")) {
|
||||
throw new IllegalArgumentException("MessageType key must match \"^[a-z0-9-]*$\"");
|
||||
if (!type.getKey().matches("^[a-z][a-z0-9-]*$")) {
|
||||
throw new IllegalArgumentException("MessageType key must match \"^[a-z][a-z0-9-]*$\"");
|
||||
}
|
||||
|
||||
if (registeredTypes.containsKey(type.getKey())) {
|
||||
|
|
Loading…
Reference in a new issue