decord/stable/source/records/InviteRecord.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

79 lines
2.5 KiB
TypeScript

// Module ID: 8498
// Function ID: 8499
// Name: InviteRecord
// Dependencies: [1386, 4228, 2]
// Module 8498 (InviteRecord)
import _modDef4228 from "module_4228" /* 4228 */;
import Record from "Record" /* 1386 */;
let InviteRecord;
class InviteRecord extends tmp2 {
constructor(arg0) {
tmp2 = new InviteRecord(tmp, new.target, new.target);
tmp3 = global.code || "";
tmp2.code = tmp3;
tmp2.temporary = global.temporary || false;
tmp2.revoked = global.revoked || false;
tmp2.uses = global.uses || 0;
tmp2.maxUses = global.maxUses || 0;
tmp2.maxAge = global.maxAge || 0;
createdAt = global.createdAt;
if (!createdAt) {
tmp4 = globalThis;
_Date = Date;
tmp5 = new.target;
tmp6 = new.target;
createdAt = new Date();
}
tmp2.createdAt = createdAt;
({ channel: tmp2.channel, guild: tmp2.guild } = global);
tmp2.inviter = global.inviter || null;
tmp2.targetType = global.targetType || null;
tmp2.targetUser = global.targetUser || null;
tmp2.targetApplication = global.targetApplication || null;
tmp2.type = global.type || null;
tmp2.flags = global.flags || 0;
tmp2.roles = global.roles || [];
return tmp2;
}
}
const prototype = InviteRecord.prototype;
InviteRecord["createFromServer"] = function createFromServer(created_at) {
const obj = {};
const merged = Object.assign(created_at);
({ max_uses: obj.maxUses, max_age: obj.maxAge } = created_at);
created_at = created_at.created_at;
obj.createdAt = _modDef4228(created_at);
({ target_type: obj.targetType, target_user: obj.targetUser, target_application: obj.targetApplication } = created_at);
return new InviteRecord(obj);
};
prototype["isExpired"] = function isExpired() {
const maxAge = this.maxAge;
if (maxAge > 0) {
const obj = _modDef4228(tmp.createdAt);
const _Date = Date;
if (addResult.isBefore(Date.now())) {
return true;
}
addResult = _modDef4228(tmp.createdAt).add(maxAge, "seconds");
}
return false;
};
prototype["getExpiresAt"] = function getExpiresAt() {
const self = this;
let num = Infinity;
if (this.maxAge > 0) {
const obj = _modDef4228(self.createdAt);
num = _modDef4228(self.createdAt).add(self.maxAge, "seconds").toDate();
const addResult = _modDef4228(self.createdAt).add(self.maxAge, "seconds");
}
return num;
};
prototype["toString"] = function toString() {
return this.code;
};
const size = fn(2);
const result = size.fileFinishedImporting("records/InviteRecord.tsx");
export default InviteRecord;