mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-05 07:57:59 +01: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
@ -212,8 +212,8 @@ public class JDADiscordService implements DiscordService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerMessageType(Plugin plugin, MessageType type) {
|
public void registerMessageType(Plugin plugin, MessageType type) {
|
||||||
if (!type.getKey().matches("^[a-z0-9-]*$")) {
|
if (!type.getKey().matches("^[a-z][a-z0-9-]*$")) {
|
||||||
throw new IllegalArgumentException("MessageType key must match \"^[a-z0-9-]*$\"");
|
throw new IllegalArgumentException("MessageType key must match \"^[a-z][a-z0-9-]*$\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (registeredTypes.containsKey(type.getKey())) {
|
if (registeredTypes.containsKey(type.getKey())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user