diff --git a/build-number.txt b/build-number.txt index 872362fa..7ff9fa9b 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1226 \ No newline at end of file +1227 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/HelpCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/HelpCommand.java index 7f05565e..12eaa36c 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/HelpCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/HelpCommand.java @@ -9,6 +9,7 @@ import me.chayapak1.chomens_bot.plugins.CommandHandlerPlugin; import me.chayapak1.chomens_bot.util.ColorUtilities; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.JoinConfiguration; +import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; @@ -85,6 +86,10 @@ public class HelpCommand extends Command { Component .text(name) .color(getColorByTrustLevel(trustLevel)) + .clickEvent( + ClickEvent.suggestCommand(context.prefix + name) // *command + ) + .insertion(context.prefix + this.name + " " + name) // *help .hoverEvent( HoverEvent.showText( sendUsages(context, name) @@ -138,18 +143,6 @@ public class HelpCommand extends Command { .append(Component.text(prefix + actualCommandName).color(ColorUtilities.getColorByString(bot.config.colorPalette.secondary))) .append(Component.text(" ")); - if (command.trustLevel == TrustLevel.TRUSTED) { - usageComponent = usageComponent - .append(Component.text("")) - .append(Component.space()) - .color(ColorUtilities.getColorByString(bot.config.colorPalette.string)); - } else if (command.trustLevel == TrustLevel.OWNER) { - usageComponent = usageComponent - .append(Component.text("")) - .append(Component.space()) - .color(ColorUtilities.getColorByString(bot.config.colorPalette.string)); - } - usageComponent = usageComponent.append(Component.text(usage).color(ColorUtilities.getColorByString(bot.config.colorPalette.string))); usages.add(usageComponent);