mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-24 16:13:12 +09:00
Update controller.ts
This commit is contained in:
1 parent
7a2f08814d
commit
e53c997260
1 file changed
+10
-4
+10
-4
@@ -119,12 +119,18 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const verb = ACTION_VERBS[action];
|
const verb = ACTION_VERBS[action];
|
||||||
|
const text = content.trim();
|
||||||
|
|
||||||
if (verb) {
|
if (!verb) {
|
||||||
await sendMessage(instanceName, `**\`${content.trim()}\`** ${verb}`);
|
await sendMessage(instanceName, `unknown action ${action} **\`${text}\`**`);
|
||||||
} else {
|
return;
|
||||||
await sendMessage(instanceName, `unknown action ${action} **\`${content.trim()}\`**`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const name = text.toLowerCase().endsWith(verb)
|
||||||
|
? text.slice(0, -verb.length).trim()
|
||||||
|
: text;
|
||||||
|
|
||||||
|
await sendMessage(instanceName, `**\`${name}\`** ${verb}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.config.on('fieldChanged', (field) => {
|
controller.config.on('fieldChanged', (field) => {
|
||||||
|
|||||||
Reference in new issue
Block a user