mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2025-12-27 03:05:21 +09:00
.
This commit is contained in:
@@ -10,18 +10,12 @@ class InstancePlugin extends BaseInstancePlugin {
|
|||||||
onControllerConnectionEvent(event) {
|
onControllerConnectionEvent(event) {
|
||||||
if (event === "connect") {
|
if (event === "connect") {
|
||||||
for (let [action, content] of this.messageQueue) {
|
for (let [action, content] of this.messageQueue) {
|
||||||
this.sendChat(action, content);
|
this.instance.sendTo("controller", new InstanceActionEvent(this.instance.name, action, content));
|
||||||
}
|
}
|
||||||
this.messageQueue = [];
|
this.messageQueue = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendChat(action, content) {
|
|
||||||
this.instance.sendTo("controller",
|
|
||||||
new InstanceActionEvent(this.instance.name, action, content)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async onOutput(output) {
|
async onOutput(output) {
|
||||||
if (output.type == "action") {
|
if (output.type == "action") {
|
||||||
this.messageQueue.push([output.action, output.message]);
|
this.messageQueue.push([output.action, output.message]);
|
||||||
|
|||||||
Reference in New Issue
Block a user