refactor: remove some outputs in console command
This commit is contained in:
parent
71d9caa0db
commit
b424f29972
2 changed files with 6 additions and 4 deletions
|
@ -48,8 +48,6 @@ public class ConsoleCommand extends Command {
|
|||
if (server.equalsIgnoreCase("all")) {
|
||||
eachBot.console.consoleServer = "all";
|
||||
|
||||
context.sendOutput(Component.text("Set the console server to all servers").color(ColorUtilities.getColorByString(bot.config.colorPalette.defaultColor)));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -59,8 +57,6 @@ public class ConsoleCommand extends Command {
|
|||
.filter(eachServer -> eachServer.toLowerCase().contains(server))
|
||||
.findFirst()
|
||||
.orElse("all");
|
||||
|
||||
context.sendOutput(Component.text("Set the console server to " + bot.console.consoleServer).color(ColorUtilities.getColorByString(bot.config.colorPalette.defaultColor)));
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
throw new CommandException(Component.text("Invalid server: " + server));
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public class LoggerUtilities {
|
|||
}
|
||||
|
||||
public static void log (String message) { log(null, message, true, true); }
|
||||
public static void log (Component message) { log(null, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void log (Bot bot, Component message) { log(bot, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void log (Bot bot, String message) { log(bot, message, true, true); }
|
||||
public static void log (Bot bot, String message, boolean logToFile, boolean logToConsole) {
|
||||
final String component = prefix(bot, Component.text("Log").color(NamedTextColor.GOLD), message);
|
||||
|
@ -58,6 +60,8 @@ public class LoggerUtilities {
|
|||
}
|
||||
|
||||
public static void info (String message) { info(null, message); }
|
||||
public static void info (Component message) { info(null, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void info (Bot bot, Component message) { info(bot, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void info (Bot bot, String message) {
|
||||
final String component = prefix(bot, Component.text("Info").color(NamedTextColor.GREEN), message);
|
||||
|
||||
|
@ -66,6 +70,8 @@ public class LoggerUtilities {
|
|||
}
|
||||
|
||||
public static void error (String message) { error(null, message); }
|
||||
public static void error (Component message) { error(null, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void error (Bot bot, Component message) { error(bot, ComponentUtilities.stringifyAnsi(message)); }
|
||||
public static void error (Bot bot, String message) {
|
||||
final String component = prefix(bot, Component.text("Error").color(NamedTextColor.RED), message);
|
||||
|
||||
|
|
Loading…
Reference in a new issue