mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-26 00:13:12 +09:00
Refactor Discord message handling and connection logic
This commit is contained in:
1 parent
e53c997260
commit
d1999a9156
1 file changed
+3
-2
+3
-2
@@ -129,8 +129,9 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
const name = text.toLowerCase().endsWith(verb)
|
const name = text.toLowerCase().endsWith(verb)
|
||||||
? text.slice(0, -verb.length).trim()
|
? text.slice(0, -verb.length).trim()
|
||||||
: text;
|
: text;
|
||||||
|
|
||||||
await sendMessage(instanceName, `**\`${name}\`** ${verb}`);
|
const pc = await controller.instances.get(instanceName).sendRcon(`/_rcon return #game.connected_players`, false, instanceName);
|
||||||
|
await sendMessage(instanceName, `**\`${name}\`** ${verb} (${pc})`);
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.config.on('fieldChanged', (field) => {
|
controller.config.on('fieldChanged', (field) => {
|
||||||
|
|||||||
Reference in new issue
Block a user