mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2025-12-27 03:05:21 +09:00
27 lines
656 B
JavaScript
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 };
|