From a21fa09a7317b416ba5497a35370de4c2a6e989f Mon Sep 17 00:00:00 2001 From: Syrent Date: Sat, 2 Sep 2023 14:35:07 +0330 Subject: [PATCH] Add help command --- .../velocityvanish/spigot/command/VanishCommand.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/ir/syrent/velocityvanish/spigot/command/VanishCommand.kt b/src/main/java/ir/syrent/velocityvanish/spigot/command/VanishCommand.kt index a1c75971..25df9e32 100644 --- a/src/main/java/ir/syrent/velocityvanish/spigot/command/VanishCommand.kt +++ b/src/main/java/ir/syrent/velocityvanish/spigot/command/VanishCommand.kt @@ -26,6 +26,15 @@ class VanishCommand( ) : Command("velocityvanish", "velocityvanish.command.vanish", "vanish", "sayanvanish", "v") { init { + val helpCommand = builder + .literal("help") + .permission(getPermission("help")) + .argument(StringArgument.optional("query", StringArgument.StringMode.GREEDY)) + .handler { context -> + help.queryCommands("$name ${context.getOrDefault("query", "")}", context.sender) + } + saveCommand(helpCommand) + val fakeJoinLiteral = addLiteral("fakejoin", ArgumentDescription.of("Send a fake join message")) .permission(getPermission("fakejoin")) .argument(StringArgument.builder("for").withCompletionsProvider { _, _ -> Ruom.onlinePlayers.map { getVanishDescription(it) } })