mirror of
https://github.com/PHIDIAS0303/ClusterChatSync.git
synced 2026-11-24 00:13:12 +09:00
Update index.ts
This commit is contained in:
1 parent
eed44d42f3
commit
8aaedf674d
1 file changed
+5
-3
@@ -11,19 +11,21 @@ export class ChatEvent {
|
|||||||
static permission = null;
|
static permission = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public instance: Instance,
|
public instanceId: number,
|
||||||
|
public instanceName: string,
|
||||||
public action: string,
|
public action: string,
|
||||||
public content: string,
|
public content: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
static jsonSchema = Type.Object({
|
static jsonSchema = Type.Object({
|
||||||
'instance': Type.Unsafe<Instance>,
|
'instanceId': Type.Integer(),
|
||||||
|
'instanceName': Type.String(),
|
||||||
'action': Type.String(),
|
'action': Type.String(),
|
||||||
'content': Type.String(),
|
'content': Type.String(),
|
||||||
});
|
});
|
||||||
|
|
||||||
static fromJSON(json: Static<typeof ChatEvent.jsonSchema>) {
|
static fromJSON(json: Static<typeof ChatEvent.jsonSchema>) {
|
||||||
return new this(json.instance, json.action, json.content);
|
return new this(json.instanceId, json.instanceName, json.action, json.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user