mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-20 23:53:13 +09:00
Update controller.ts
This commit is contained in:
1 parent
6728c76782
commit
ddb14e644e
1 file changed
+4
-4
+4
-4
@@ -130,17 +130,17 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
? text.slice(0, -verb.length).trim()
|
? text.slice(0, -verb.length).trim()
|
||||||
: text;
|
: text;
|
||||||
|
|
||||||
const id = [...controller.instances.values()].find(i => i.config.get('instance.name') === instanceName).id;
|
const instance = [...controller.instances.values()].find(i => i.config.get('instance.name') === instanceName);
|
||||||
const connection = await controller.instances.get(id);
|
|
||||||
|
|
||||||
if (!connection) {
|
if (!instance) {
|
||||||
await sendMessage(instanceName, `**\`${name}\`** ${verb}`);
|
await sendMessage(instanceName, `**\`${name}\`** ${verb}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pc = '';
|
let pc = '';
|
||||||
|
|
||||||
try {
|
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 {
|
} catch {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user