From 47f29e8bc7f8ca5aa94709a371760e4c520a4de2 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 28 Jun 2024 09:19:00 +0200 Subject: [PATCH] Fix discord command registration Signed-off-by: Lixfel --- src/de/steamwar/velocitycore/discord/DiscordBot.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/velocitycore/discord/DiscordBot.java b/src/de/steamwar/velocitycore/discord/DiscordBot.java index 895e0201..3015046e 100644 --- a/src/de/steamwar/velocitycore/discord/DiscordBot.java +++ b/src/de/steamwar/velocitycore/discord/DiscordBot.java @@ -187,7 +187,8 @@ public class DiscordBot { updateCommands .addCommands(getCommands() .keySet().stream() - .map(swCommand -> new CommandData(swCommand, "SteamWar Command").addOptions(new OptionData(OptionType.STRING, ARGUMENT_NAME, "SteamWar arguments", false))) + .filter(command -> command.matches("^[\\w-]+$.")) + .map(command -> new CommandData(command, "SteamWar Command").addOptions(new OptionData(OptionType.STRING, ARGUMENT_NAME, "SteamWar arguments", false))) .toArray(CommandData[]::new)) .complete(); }