diff --git a/src/main/java/me/chayapak1/chomens_bot/command/ConsoleCommandContext.java b/src/main/java/me/chayapak1/chomens_bot/command/ConsoleCommandContext.java index b8494e6..bce541f 100644 --- a/src/main/java/me/chayapak1/chomens_bot/command/ConsoleCommandContext.java +++ b/src/main/java/me/chayapak1/chomens_bot/command/ConsoleCommandContext.java @@ -15,7 +15,7 @@ public class ConsoleCommandContext extends CommandContext { @Override public void sendOutput (Component component) { - final String message = ComponentUtilities.stringify(component); + final String message = ComponentUtilities.stringifyAnsi(component); bot.logger().log(message); } diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/BotVisibilityCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/BotVisibilityCommand.java index 40ab525..f510d04 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/BotVisibilityCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/BotVisibilityCommand.java @@ -41,7 +41,7 @@ public class BotVisibilityCommand implements Command { public Component execute(CommandContext context, String[] args, String[] fullArgs) { final Bot bot = context.bot(); - if (args[0] == null) { + if (args.length == 0) { final boolean visibility = bot.selfCare().visibility(); bot.selfCare().visibility(!visibility); @@ -58,6 +58,7 @@ public class BotVisibilityCommand implements Command { switch (args[0]) { case "on", "true" -> { bot.selfCare().visibility(true); + bot.chat().send("/essentials:vanish disable"); context.sendOutput( Component.empty() .append(Component.text("The bot's visibility is now ")) @@ -66,6 +67,7 @@ public class BotVisibilityCommand implements Command { } case "off", "false" -> { bot.selfCare().visibility(false); + bot.chat().send("/essentials:vanish enable"); context.sendOutput( Component.empty() .append(Component.text("The bot's visibility is now ")) diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/CommandHandlerPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/CommandHandlerPlugin.java index 7a3f3fc..cef2d96 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/CommandHandlerPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/CommandHandlerPlugin.java @@ -112,6 +112,7 @@ public class CommandHandlerPlugin { count++; } } + if (usage.contains("")) count--; // bad fix? return count; }