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
+11 -5
+11 -5
View File
@@ -119,12 +119,18 @@ export default async function(context: ControllerPluginContext) {
}
const verb = ACTION_VERBS[action];
if (verb) {
await sendMessage(instanceName, `**\`${content.trim()}\`** ${verb}`);
} else {
await sendMessage(instanceName, `unknown action ${action} **\`${content.trim()}\`**`);
const text = content.trim();
if (!verb) {
await sendMessage(instanceName, `unknown action ${action} **\`${text}\`**`);
return;
}
const name = text.toLowerCase().endsWith(verb)
? text.slice(0, -verb.length).trim()
: text;
await sendMessage(instanceName, `**\`${name}\`** ${verb}`);
});
controller.config.on('fieldChanged', (field) => {