Files
factorio-clusterio-plugin-C…/message.js
2025-08-15 20:10:16 +09:00

27 lines
656 B
JavaScript

const { Type } = require("@sinclair/typebox");
class ChatEvent {
static type = "event";
static src = ["control", "instance"];
static dst = "instance";
static plugin = "global_chat";
static permission = null;
static jsonSchema = Type.Object({
"instanceName": Type.String(),
"content": Type.String(),
});
constructor(instanceName, content) {
this.instanceName = instanceName;
this.content = content;
}
static fromJSON(json) {
return new ChatEvent(json.instanceName, json.content);
}
}
// If you need to use this class in other files
module.exports = { ChatEvent };