From ddb14e644eb2c10e7af7b29a8dca17e20d2fec3d Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 12 Oct 2026 14:48:19 +0900 Subject: [PATCH] Update controller.ts --- controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controller.ts b/controller.ts index e7001d9..a465ae2 100644 --- a/controller.ts +++ b/controller.ts @@ -130,17 +130,17 @@ export default async function(context: ControllerPluginContext) { ? text.slice(0, -verb.length).trim() : text; - const id = [...controller.instances.values()].find(i => i.config.get('instance.name') === instanceName).id; - const connection = await controller.instances.get(id); + const instance = [...controller.instances.values()].find(i => i.config.get('instance.name') === instanceName); - if (!connection) { + if (!instance) { await sendMessage(instanceName, `**\`${name}\`** ${verb}`); return; } let pc = ''; + try { - pc = String(await connection.sendRcon('/_rcon return #game.connected_players', false, instanceName)).trim(); + pc = String(await instance.sendRcon('/_rcon return #game.connected_players', false, instanceName)).trim(); } catch { }