mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-11 15:14:52 +09:00
Update controller.ts
This commit is contained in:
1 parent
7a2f08814d
commit
e53c997260
1 file changed
+11
-5
+11
-5
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user