From b9386f86e1bf5e52a988358a58743a9eb954e00e Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 12 Apr 2025 11:59:29 +0700 Subject: [PATCH] fix: netcmd still executing on `all` server even when bot not logged in --- build-number.txt | 2 +- .../me/chayapak1/chomens_bot/commands/NetCommandCommand.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-number.txt b/build-number.txt index 33c15029..7c43ea01 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -2671 \ No newline at end of file +2672 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/NetCommandCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/NetCommandCommand.java index 34b6f7d8..dedbe692 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/NetCommandCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/NetCommandCommand.java @@ -38,8 +38,6 @@ public class NetCommandCommand extends Command { final String[] servers = rawServers.split(","); for (final Bot bot : allBots) { - if (!bot.loggedIn) continue; - for (final String server : servers) { if ( server.isBlank() @@ -59,6 +57,8 @@ public class NetCommandCommand extends Command { final String command = context.getString(true, true); for (final Bot bot : bots) { + if (!bot.loggedIn) continue; + final CommandContext remoteContext = new RemoteCommandContext(bot, context); context.bot.commandHandler.executeCommand(command, remoteContext, null);