Files
discord-decomp/records/InteractionRecord.tsx
T
2026-11-01 12:12:55 +02:00

40 lines
1.1 KiB
TypeScript

// Metro module 4410 (f4411).
import Record from "../lib/Record";
import UserRecord from "./UserRecord";
import { $callWithNewTarget } from "../_hermes/prelude";
class InteractionRecord extends Record {
constructor(a0) {
super();
this.id = a0.id;
this.name = a0.name;
this.type = a0.type;
this.user = a0.user;
let name_localized = a0.name_localized;
if (name_localized == null) {
name_localized = a0.name;
}
this.displayName = name_localized;
}
static createFromServer(a0) {
const r3 = {
...a0,
user: new UserRecord(a0.user)
};
const prototypeOf = Object.getPrototypeOf(InteractionRecord);
const r19 = Object.create(InteractionRecord.prototype);
const r21 = $callWithNewTarget(prototypeOf, r19, InteractionRecord);
const r22 = r21 instanceof Object ? r21 : r19;
r22.id = r3.id;
r22.name = r3.name;
r22.type = r3.type;
r22.user = r3.user;
let name_localized = r3.name_localized;
if (name_localized == null) {
name_localized = r3.name;
}
r22.displayName = name_localized;
return r22;
}
}
export default InteractionRecord;