mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-22 00:03:12 +09:00
.
This commit is contained in:
1 parent
63fa42006c
commit
a978173f06
2 files changed
+4
-7
No files matched your search
@@ -122,6 +122,8 @@ export default async function(context: ControllerPluginContext) {
|
|||||||
|
|
||||||
if (verb) {
|
if (verb) {
|
||||||
await sendMessage(instanceName, `**\`${content.trim()}\`** ${verb}`);
|
await sendMessage(instanceName, `**\`${content.trim()}\`** ${verb}`);
|
||||||
|
} else {
|
||||||
|
await sendMessage(instanceName, `unknown action ${action} **\`${content.trim()}\`**`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+2
-7
@@ -2,7 +2,7 @@ import type {InstancePluginContext} from '@clusterio/host';
|
|||||||
import {ChatEvent} from './index.js';
|
import {ChatEvent} from './index.js';
|
||||||
|
|
||||||
export default async function(context: InstancePluginContext) {
|
export default async function(context: InstancePluginContext) {
|
||||||
const {instance, host, logger, plugin} = context;
|
const {instance, host, plugin} = context;
|
||||||
let queue: [string, string][] = [];
|
let queue: [string, string][] = [];
|
||||||
|
|
||||||
instance.hooks.controllerConnectionEvent.attach(plugin.name, async (event) => {
|
instance.hooks.controllerConnectionEvent.attach(plugin.name, async (event) => {
|
||||||
@@ -26,12 +26,7 @@ export default async function(context: InstancePluginContext) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
instance.hooks.output.attach(plugin.name, async (output) => {
|
instance.hooks.output.attach(plugin.name, async (output) => {
|
||||||
if (output.type === 'info') {
|
if (output.type !== 'action' && output.type !== 'info') {
|
||||||
logger.info(output.message)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (output.type !== 'action') {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user