Update controller.ts

This commit is contained in:
phidias authored and GitHub committed 2026-10-12 14:17:20 +09:00
1 parent 7a2f08814d
commit e53c997260
1 file changed
+10 -4
+10 -4
View File
@@ -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) => {