1366 lines
47 KiB
TypeScript
1366 lines
47 KiB
TypeScript
// Metro module 1376 (f1377).
|
|
import StageInstanceStore from "../modules/stage_channels/StageInstanceStore";
|
|
import * as _Constants from "../Constants";
|
|
import { BITRATE_DEFAULT, ChannelTypesSets } from "../Constants";
|
|
import { ChannelFlags } from "../modules/channel/ChannelConstants";
|
|
import { combine } from "../_bundle/HighLow";
|
|
import Module12 from "../_bundle/Module12";
|
|
import { LURKER_STAGE_CHANNEL_PERMISSIONS_ALLOWLIST } from "../modules/stage_channels/StageChannelPermissions";
|
|
import { ThreadSortOrder } from "../_bundle/Module1381";
|
|
import { ForumLayout } from "../_bundle/Module1382";
|
|
import { ThreadSearchTagSetting } from "../_bundle/Module1383";
|
|
import * as _Module1384 from "../_bundle/Module1384";
|
|
import { dangerouslyCast } from "../_bundle/Module1385";
|
|
import LRUCache from "../_bundle/LRUCache";
|
|
import SnowflakeUtils from "../utils/SnowflakeUtils";
|
|
function $mk69158($env) {
|
|
return (a0) => {
|
|
const r3 = $env[0];
|
|
const id = a0.id;
|
|
const r12 = $env.$parent;
|
|
const r6 = r12[2];
|
|
const r13 = r12[3];
|
|
r3[id] = {
|
|
id: a0.id,
|
|
type: a0.type,
|
|
allow: r6(r13[3]).deserialize(a0.allow),
|
|
deny: r6(r13[3]).deserialize(a0.deny)
|
|
};
|
|
};
|
|
}
|
|
function $mk69159() {
|
|
return (a0, a1) => {
|
|
a0[a1.id] = a1.nick;
|
|
return a0;
|
|
};
|
|
}
|
|
function $mk69160() {
|
|
return (a0) => ({
|
|
id: a0.id,
|
|
name: a0.name,
|
|
emojiId: a0.emoji_id !== 0 ? a0.emoji_id : void 0,
|
|
emojiName: a0.emoji_name,
|
|
moderated: a0.moderated,
|
|
color: a0.color
|
|
});
|
|
}
|
|
let c1145_11, c1145_12, c1145_13, c1145_14, c1145_15, c1145_16, c1145_17, c1145_18, c1145_19, c1145_20, c1145_21, c1145_22, c1145_23, c1145_24, c1145_25, c1145_50, c1145_33, c1145_46, c1145_26, c1145_44, c1145_36, c1145_37, c1145_38, c1145_39, c1145_40, c1145_41, c1145_42, c1145_43, c1145_35, c1145_45, c1145_27, c1145_28, c1145_34, c1145_47, c1145_48, c1145_49, c1145_32, c1145_51, c1145_29, c1145_30;
|
|
let env1145 = {};
|
|
export function createChannelRecord(a0) {
|
|
let type = a0.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
let r8 = c1145_30[type];
|
|
if (r8 == null) {
|
|
r8 = c1145_26;
|
|
}
|
|
if ("topic" in a0) {
|
|
a0.topic_ = a0.topic;
|
|
delete a0["topic"];
|
|
}
|
|
if ("position" in a0) {
|
|
a0.position_ = a0.position;
|
|
delete a0["position"];
|
|
}
|
|
if ("permissionOverwrites" in a0) {
|
|
a0.permissionOverwrites_ = a0.permissionOverwrites;
|
|
delete a0["permissionOverwrites"];
|
|
}
|
|
if ("bitrate" in a0) {
|
|
a0.bitrate_ = a0.bitrate;
|
|
delete a0["bitrate"];
|
|
}
|
|
if ("userLimit" in a0) {
|
|
a0.userLimit_ = a0.userLimit;
|
|
delete a0["userLimit"];
|
|
}
|
|
if ("nsfw" in a0) {
|
|
a0.nsfw_ = a0.nsfw;
|
|
delete a0["nsfw"];
|
|
}
|
|
if ("rateLimitPerUser" in a0) {
|
|
a0.rateLimitPerUser_ = a0.rateLimitPerUser;
|
|
delete a0["rateLimitPerUser"];
|
|
}
|
|
if ("flags" in a0) {
|
|
a0.flags_ = a0.flags;
|
|
delete a0["flags"];
|
|
}
|
|
return new r8(a0);
|
|
}
|
|
const { ChannelTypes: ChannelTypes2, BasicPermissions: BasicPermissions2, Permissions: Permissions2 } = _Constants;
|
|
c1145_11 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.DM, ChannelTypes2.GROUP_DM]);
|
|
const set22 = new Set([ChannelTypes2.DM, ChannelTypes2.GROUP_DM, ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE, ChannelTypes2.GUILD_CATEGORY, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_STORE, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.MEDIA_THREAD]);
|
|
c1145_12 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD]);
|
|
const set21 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
c1145_13 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE, ChannelTypes2.GUILD_CATEGORY, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_STORE, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
const set19 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
c1145_14 = new Set([ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
const set17 = new Set([ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
c1145_15 = new Set([ChannelTypes2.DM, ChannelTypes2.GROUP_DM]);
|
|
c1145_16 = new Set([ChannelTypes2.GROUP_DM]);
|
|
c1145_17 = new Set([ChannelTypes2.DM, ChannelTypes2.GROUP_DM, ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD]);
|
|
c1145_18 = new Set([ChannelTypes2.DM, ChannelTypes2.GROUP_DM, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD]);
|
|
c1145_19 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.DM, ChannelTypes2.GROUP_DM]);
|
|
c1145_20 = new Set([ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.MEDIA_THREAD]);
|
|
c1145_21 = new Set([ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD]);
|
|
const set13 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
c1145_22 = new Set([ChannelTypes2.DM, ChannelTypes2.GROUP_DM, ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
const set12 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_STORE, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
const set11 = new Set([ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_CATEGORY, ChannelTypes2.GUILD_STORE, ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE, ChannelTypes2.GUILD_DIRECTORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
const set10 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT]);
|
|
const set9 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
const set8 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
const set7 = new Set([ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.ANNOUNCEMENT_THREAD]);
|
|
const set6 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA, ChannelTypes2.ANNOUNCEMENT_THREAD, ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
const set5 = new Set([ChannelTypes2.PUBLIC_THREAD, ChannelTypes2.PRIVATE_THREAD, ChannelTypes2.GUILD_VOICE, ChannelTypes2.GUILD_STAGE_VOICE]);
|
|
const set4 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_MEDIA]);
|
|
const set3 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_CATEGORY, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_ANNOUNCEMENT]);
|
|
const set2 = new Set([ChannelTypes2.GUILD_TEXT, ChannelTypes2.GUILD_ANNOUNCEMENT, ChannelTypes2.GUILD_FORUM, ChannelTypes2.GUILD_VOICE]);
|
|
c1145_23 = combine(Permissions2.CONNECT, Permissions2.VIEW_CHANNEL);
|
|
c1145_24 = BasicPermissions2.CONNECT | BasicPermissions2.VIEW_CHANNEL;
|
|
export class ChannelRecordProperties {
|
|
constructor(a0) {
|
|
this.id = a0.id;
|
|
let type = a0.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
this.type = type;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
this.name = name;
|
|
let guild_id = a0.guild_id;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
this.guild_id = guild_id;
|
|
}
|
|
}
|
|
ChannelRecordProperties.prototype;
|
|
c1145_25 = Object.freeze({});
|
|
export class ChannelRecordBase extends ChannelRecordProperties {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
get permissionOverwrites() {
|
|
let permissionOverwrites_ = this.permissionOverwrites_;
|
|
if (permissionOverwrites_ == null) {
|
|
permissionOverwrites_ = c1145_25;
|
|
}
|
|
return permissionOverwrites_;
|
|
}
|
|
get topic() {
|
|
let topic_ = this.topic_;
|
|
if (topic_ == null) {
|
|
topic_ = "";
|
|
}
|
|
return topic_;
|
|
}
|
|
get position() {
|
|
let position_ = this.position_;
|
|
if (position_ == null) {
|
|
position_ = 0;
|
|
}
|
|
return position_;
|
|
}
|
|
get bitrate() {
|
|
let bitrate_ = this.bitrate_;
|
|
if (bitrate_ == null) {
|
|
bitrate_ = BITRATE_DEFAULT;
|
|
}
|
|
return bitrate_;
|
|
}
|
|
get userLimit() {
|
|
let userLimit_ = this.userLimit_;
|
|
if (userLimit_ == null) {
|
|
userLimit_ = 0;
|
|
}
|
|
return userLimit_;
|
|
}
|
|
get nsfw() {
|
|
let nsfw_ = this.nsfw_;
|
|
if (nsfw_ == null) {
|
|
nsfw_ = false;
|
|
}
|
|
return nsfw_;
|
|
}
|
|
get rateLimitPerUser() {
|
|
let rateLimitPerUser_ = this.rateLimitPerUser_;
|
|
if (rateLimitPerUser_ == null) {
|
|
rateLimitPerUser_ = 0;
|
|
}
|
|
return rateLimitPerUser_;
|
|
}
|
|
get flags() {
|
|
let flags_ = this.flags_;
|
|
if (flags_ == null) {
|
|
flags_ = 0;
|
|
}
|
|
return flags_;
|
|
}
|
|
toJS() {
|
|
return {
|
|
...this
|
|
};
|
|
}
|
|
set(a0, a1) {
|
|
const merge2 = this.merge;
|
|
const r1 = {};
|
|
r1[a0] = a1;
|
|
if ("topic" in r1) {
|
|
r1.topic_ = r1.topic;
|
|
delete r1["topic"];
|
|
}
|
|
if ("position" in r1) {
|
|
r1.position_ = r1.position;
|
|
delete r1["position"];
|
|
}
|
|
if ("permissionOverwrites" in r1) {
|
|
r1.permissionOverwrites_ = r1.permissionOverwrites;
|
|
delete r1["permissionOverwrites"];
|
|
}
|
|
if ("bitrate" in r1) {
|
|
r1.bitrate_ = r1.bitrate;
|
|
delete r1["bitrate"];
|
|
}
|
|
if ("userLimit" in r1) {
|
|
r1.userLimit_ = r1.userLimit;
|
|
delete r1["userLimit"];
|
|
}
|
|
if ("nsfw" in r1) {
|
|
r1.nsfw_ = r1.nsfw;
|
|
delete r1["nsfw"];
|
|
}
|
|
if ("rateLimitPerUser" in r1) {
|
|
r1.rateLimitPerUser_ = r1.rateLimitPerUser;
|
|
delete r1["rateLimitPerUser"];
|
|
}
|
|
if ("flags" in r1) {
|
|
r1.flags_ = r1.flags;
|
|
delete r1["flags"];
|
|
}
|
|
return merge2.call(this, r1);
|
|
}
|
|
merge(a0) {
|
|
let r12;
|
|
if ("topic" in a0) {
|
|
a0.topic_ = a0.topic;
|
|
delete a0["topic"];
|
|
}
|
|
if ("position" in a0) {
|
|
a0.position_ = a0.position;
|
|
delete a0["position"];
|
|
}
|
|
if ("permissionOverwrites" in a0) {
|
|
a0.permissionOverwrites_ = a0.permissionOverwrites;
|
|
delete a0["permissionOverwrites"];
|
|
}
|
|
if ("bitrate" in a0) {
|
|
a0.bitrate_ = a0.bitrate;
|
|
delete a0["bitrate"];
|
|
}
|
|
if ("userLimit" in a0) {
|
|
a0.userLimit_ = a0.userLimit;
|
|
delete a0["userLimit"];
|
|
}
|
|
if ("nsfw" in a0) {
|
|
a0.nsfw_ = a0.nsfw;
|
|
delete a0["nsfw"];
|
|
}
|
|
if ("rateLimitPerUser" in a0) {
|
|
a0.rateLimitPerUser_ = a0.rateLimitPerUser;
|
|
delete a0["rateLimitPerUser"];
|
|
}
|
|
if ("flags" in a0) {
|
|
a0.flags_ = a0.flags;
|
|
delete a0["flags"];
|
|
}
|
|
let r49 = null;
|
|
let r7 = null;
|
|
for (const key in a0) {
|
|
r12 = r49;
|
|
r7 = r12;
|
|
const r50 = a0.hasOwnProperty(key) && this[key] !== a0[key];
|
|
r49 = r12;
|
|
if (r50) {
|
|
const r51 = r12 == null ? this.toJS() : r12;
|
|
r51[key] = a0[key];
|
|
r49 = r51;
|
|
}
|
|
}
|
|
r12 = r49;
|
|
r7 = r12;
|
|
return r7 != null ? new this.constructor(r7) : this;
|
|
}
|
|
computeLurkerPermissionsAllowList() {
|
|
if (this.isGuildStageVoice() && StageInstanceStore.isPublic(this.id)) {
|
|
return LURKER_STAGE_CHANNEL_PERMISSIONS_ALLOWLIST;
|
|
}
|
|
}
|
|
isNSFW() {
|
|
return this.nsfw;
|
|
}
|
|
isManaged() {
|
|
return this.application_id != null;
|
|
}
|
|
isPrivate() {
|
|
return c1145_15.has(this.type);
|
|
}
|
|
isGroupDM() {
|
|
return this.type === _Constants.ChannelTypes.GROUP_DM;
|
|
}
|
|
isMultiUserDM() {
|
|
return c1145_16.has(this.type);
|
|
}
|
|
isDM() {
|
|
return this.type === _Constants.ChannelTypes.DM;
|
|
}
|
|
isSystemDM() {
|
|
return false;
|
|
}
|
|
isArchivedThread() {
|
|
return this.isThread() && this.threadMetadata?.archived === true;
|
|
}
|
|
isLockedThread() {
|
|
return this.isThread() && this.threadMetadata?.locked === true;
|
|
}
|
|
isScheduledForDeletion() {
|
|
return this.hasFlag(ChannelFlags.IS_SCHEDULED_FOR_DELETION);
|
|
}
|
|
isArchivedLockedThread() {
|
|
return c1145_20.has(this.type) && this.threadMetadata?.archived === true && this.threadMetadata?.locked === true;
|
|
}
|
|
isForumPost() {
|
|
return this.type === _Constants.ChannelTypes.PUBLIC_THREAD && this.parentChannelThreadType != null && ChannelTypesSets.GUILD_THREADS_ONLY.has(this.parentChannelThreadType);
|
|
}
|
|
isMediaThread() {
|
|
return this.type === _Constants.ChannelTypes.MEDIA_THREAD;
|
|
}
|
|
isRingable() {
|
|
return ChannelTypesSets.CALLABLE.has(this.type) || this.type === _Constants.ChannelTypes.GUILD_VOICE;
|
|
}
|
|
isCategory() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_CATEGORY;
|
|
}
|
|
isVocal() {
|
|
return c1145_18.has(this.type);
|
|
}
|
|
isGuildVocal() {
|
|
const type = this.type;
|
|
return type !== "SELECTABLE" && c1145_14.has(type);
|
|
}
|
|
isGuildVocalOrThread() {
|
|
return this.isGuildVocal() || this.isVocalThread();
|
|
}
|
|
isGuildVoice() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_VOICE;
|
|
}
|
|
isGuildVoiceOrThread() {
|
|
return this.isGuildVoice() || this.isVocalThread();
|
|
}
|
|
isGuildStageVoice() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_STAGE_VOICE;
|
|
}
|
|
isListenModeCapable() {
|
|
return this.isGuildStageVoice();
|
|
}
|
|
isThread() {
|
|
return c1145_20.has(this.type);
|
|
}
|
|
isAnnouncementThread() {
|
|
return this.type === _Constants.ChannelTypes.ANNOUNCEMENT_THREAD;
|
|
}
|
|
isVocalThread() {
|
|
return this.type === _Constants.ChannelTypes.PUBLIC_THREAD || this.type === _Constants.ChannelTypes.PRIVATE_THREAD;
|
|
}
|
|
isActiveThread() {
|
|
return this.isThread() && this.threadMetadata?.archived !== true;
|
|
}
|
|
isDirectory() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_DIRECTORY;
|
|
}
|
|
isForumLikeChannel() {
|
|
return this.isForumChannel() || this.isMediaChannel();
|
|
}
|
|
isForumChannel() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_FORUM;
|
|
}
|
|
isMediaChannel() {
|
|
return this.type === _Constants.ChannelTypes.GUILD_MEDIA;
|
|
}
|
|
isMediaPost() {
|
|
return this.type === _Constants.ChannelTypes.PUBLIC_THREAD && this.parentChannelThreadType === _Constants.ChannelTypes.GUILD_MEDIA;
|
|
}
|
|
isRoleSubscriptionTemplatePreviewChannel() {
|
|
return this.hasFlag(ChannelFlags.IS_ROLE_SUBSCRIPTION_TEMPLATE_PREVIEW_CHANNEL);
|
|
}
|
|
isOwner(a0) {
|
|
return this.ownerId === a0;
|
|
}
|
|
isObfuscated() {
|
|
return this.hasFlag(ChannelFlags.OBFUSCATED);
|
|
}
|
|
getGuildId() {
|
|
return this.guild_id;
|
|
}
|
|
getApplicationId() {
|
|
return this.application_id;
|
|
}
|
|
getDefaultSortOrder() {
|
|
let CREATION_DATE;
|
|
if (this.isGameInvitesChannel()) {
|
|
CREATION_DATE = ThreadSortOrder.CREATION_DATE;
|
|
} else {
|
|
CREATION_DATE = this.defaultSortOrder;
|
|
if (CREATION_DATE == null) {
|
|
CREATION_DATE = ThreadSortOrder.LATEST_ACTIVITY;
|
|
}
|
|
}
|
|
return CREATION_DATE;
|
|
}
|
|
getDefaultLayout() {
|
|
let defaultForumLayout;
|
|
L8: {
|
|
if (!this.isMediaChannel() && !this.isGameInvitesChannel()) {
|
|
if (this.defaultForumLayout != null && this.defaultForumLayout !== ForumLayout.DEFAULT) {
|
|
defaultForumLayout = this.defaultForumLayout;
|
|
break L8;
|
|
}
|
|
defaultForumLayout = ForumLayout.LIST;
|
|
} else {
|
|
defaultForumLayout = ForumLayout.GRID;
|
|
}
|
|
}
|
|
return defaultForumLayout;
|
|
}
|
|
getDefaultTagSetting() {
|
|
let defaultTagSetting = this.defaultTagSetting;
|
|
if (defaultTagSetting == null) {
|
|
defaultTagSetting = ThreadSearchTagSetting.MATCH_SOME;
|
|
}
|
|
return defaultTagSetting;
|
|
}
|
|
isModeratorReportChannel() {
|
|
return this.hasFlag(ChannelFlags.IS_MODERATOR_REPORT_CHANNEL);
|
|
}
|
|
isSpoilerChannel() {
|
|
return this.hasFlag(ChannelFlags.IS_SPOILER_CHANNEL);
|
|
}
|
|
isGameInvitesChannel() {
|
|
return this.hasFlag(ChannelFlags.IS_GAME_INVITES_CHANNEL);
|
|
}
|
|
get accessPermissions() {
|
|
const type = this.type;
|
|
return type !== "SELECTABLE" && c1145_14.has(type) ? c1145_23 : _Constants.Permissions.VIEW_CHANNEL;
|
|
}
|
|
hasFlag(a0) {
|
|
return _Module1384.hasFlag(this.flags, a0);
|
|
}
|
|
get isHDStreamSplashed() {
|
|
return this.hdStreamingUntil != null && new Date(this.hdStreamingUntil) > new Date();
|
|
}
|
|
}
|
|
c1145_50 = ChannelRecordBase;
|
|
c1145_33 = void 0;
|
|
export class UnknownChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
this.application_id = a0.application_id;
|
|
this.appliedTags = a0.appliedTags;
|
|
this.availableTags = a0.availableTags;
|
|
this.bitrate_ = a0.bitrate_;
|
|
this.defaultAutoArchiveDuration = a0.defaultAutoArchiveDuration;
|
|
this.defaultForumLayout = a0.defaultForumLayout;
|
|
this.defaultReactionEmoji = a0.defaultReactionEmoji;
|
|
this.defaultSortOrder = a0.defaultSortOrder;
|
|
this.defaultTagSetting = a0.defaultTagSetting;
|
|
this.defaultThreadRateLimitPerUser = a0.defaultThreadRateLimitPerUser;
|
|
this.flags_ = a0.flags_;
|
|
this.icon = a0.icon;
|
|
this.iconEmoji = a0.iconEmoji;
|
|
this.isMessageRequest = a0.isMessageRequest;
|
|
this.isMessageRequestTimestamp = a0.isMessageRequestTimestamp;
|
|
this.isSpam = a0.isSpam;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.member = a0.member;
|
|
this.memberCount = a0.memberCount;
|
|
this.memberIdsPreview = a0.memberIdsPreview;
|
|
this.memberListId = a0.memberListId;
|
|
this.messageCount = a0.messageCount;
|
|
this.nicks = a0.nicks;
|
|
this.nsfw_ = a0.nsfw_;
|
|
this.originChannelId = a0.originChannelId;
|
|
this.ownerId = a0.ownerId;
|
|
this.parent_id = a0.parent_id;
|
|
this.parentChannelThreadType = a0.parentChannelThreadType;
|
|
this.permissionOverwrites_ = a0.permissionOverwrites_;
|
|
this.position_ = a0.position_;
|
|
this.rateLimitPerUser_ = a0.rateLimitPerUser_;
|
|
this.rawRecipients = a0.rawRecipients;
|
|
this.recipients = a0.recipients;
|
|
this.recipientFlags = a0.recipientFlags;
|
|
this.rtcRegion = a0.rtcRegion;
|
|
this.safetyWarnings = a0.safetyWarnings;
|
|
this.blockedUserWarningDismissed = a0.blockedUserWarningDismissed;
|
|
this.template = a0.template;
|
|
this.themeColor = a0.themeColor;
|
|
this.threadMetadata = a0.threadMetadata;
|
|
this.topic_ = a0.topic_;
|
|
this.userLimit_ = a0.userLimit_;
|
|
this.version = a0.version;
|
|
this.videoQualityMode = a0.videoQualityMode;
|
|
this.linkedLobby = a0.linkedLobby;
|
|
this.hdStreamingUntil = a0.hdStreamingUntil;
|
|
this.hdStreamingBuyerId = a0.hdStreamingBuyerId;
|
|
this.voiceHangout = a0.voiceHangout;
|
|
this.lastNonMessageActivityTimestamp = a0.lastNonMessageActivityTimestamp;
|
|
}
|
|
static fromServer(a0, a1) {
|
|
const r3 = a0.available_tags != null;
|
|
let availableTags = void 0;
|
|
if (r3) {
|
|
const available_tags = a0.available_tags;
|
|
availableTags = available_tags == null ? [] : available_tags.map($mk69160());
|
|
}
|
|
const defaultReactionEmoji = a0.default_reaction_emoji != null ? {
|
|
emojiId: a0.default_reaction_emoji.emoji_id !== 0 ? a0.default_reaction_emoji.emoji_id : void 0,
|
|
emojiName: a0.default_reaction_emoji.emoji_name
|
|
} : void 0;
|
|
let guild_id = a1 == null ? a0.guild_id : a1;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
const icon_emoji = a0.icon_emoji;
|
|
const iconEmoji = icon_emoji != null ? {
|
|
id: icon_emoji.id,
|
|
name: icon_emoji.name
|
|
} : void 0;
|
|
const member = a0.member != null ? {
|
|
flags: a0.member.flags,
|
|
muted: a0.member.muted,
|
|
muteConfig: a0.member.mute_config,
|
|
joinTimestamp: a0.member.join_timestamp
|
|
} : void 0;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
const nicks = a0.nicks;
|
|
const nicks2 = nicks == null ? {} : Module12.reduce(nicks, $mk69159(), {});
|
|
let env13007;
|
|
const permission_overwrites = a0.permission_overwrites;
|
|
const r77 = env13007 = {
|
|
$parent: env1145
|
|
};
|
|
const permissionOverwrites_ = {};
|
|
env13007[0] = permissionOverwrites_;
|
|
if (permission_overwrites != null) {
|
|
permission_overwrites.forEach($mk69158(r77));
|
|
}
|
|
const rawRecipients = a0.recipients != null ? a0.recipients : [];
|
|
const recipients = a0.recipients != null ? a0.recipients.map((recipient) => recipient.id) : [];
|
|
const r98 = a0.thread_metadata != null;
|
|
let threadMetadata = void 0;
|
|
if (r98) {
|
|
let invitable = a0.thread_metadata.invitable;
|
|
if (invitable == null) {
|
|
invitable = true;
|
|
}
|
|
threadMetadata = {
|
|
archived: a0.thread_metadata.archived,
|
|
autoArchiveDuration: a0.thread_metadata.auto_archive_duration,
|
|
archiveTimestamp: a0.thread_metadata.archive_timestamp,
|
|
createTimestamp: a0.thread_metadata.create_timestamp,
|
|
locked: a0.thread_metadata.locked,
|
|
invitable
|
|
};
|
|
}
|
|
return dangerouslyCast({
|
|
application_id: a0.application_id,
|
|
appliedTags: a0.applied_tags,
|
|
availableTags,
|
|
bitrate_: a0.bitrate,
|
|
defaultAutoArchiveDuration: a0.default_auto_archive_duration,
|
|
defaultForumLayout: a0.default_forum_layout,
|
|
defaultReactionEmoji,
|
|
defaultSortOrder: a0.default_sort_order,
|
|
defaultTagSetting: a0.default_tag_setting,
|
|
defaultThreadRateLimitPerUser: a0.default_thread_rate_limit_per_user,
|
|
flags_: a0.flags,
|
|
guild_id,
|
|
icon: a0.icon,
|
|
iconEmoji,
|
|
id: a0.id,
|
|
isMessageRequest: a0.is_message_request,
|
|
isMessageRequestTimestamp: a0.is_message_request_timestamp,
|
|
isSpam: a0.is_spam,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
member,
|
|
memberCount: a0.member_count,
|
|
memberIdsPreview: a0.member_ids_preview,
|
|
memberListId: a0.member_list_id,
|
|
messageCount: a0.message_count,
|
|
name,
|
|
nicks: nicks2,
|
|
nsfw_: a0.nsfw,
|
|
originChannelId: a0.origin_channel_id,
|
|
ownerId: a0.owner_id,
|
|
parent_id: a0.parent_id,
|
|
parentChannelThreadType: void 0,
|
|
permissionOverwrites_,
|
|
position_: a0.position,
|
|
rateLimitPerUser_: a0.rate_limit_per_user,
|
|
rawRecipients,
|
|
recipients,
|
|
recipientFlags: a0.recipient_flags,
|
|
rtcRegion: a0.rtc_region,
|
|
safetyWarnings: a0.safety_warnings,
|
|
blockedUserWarningDismissed: a0.blocked_user_warning_dismissed,
|
|
template: a0.template,
|
|
themeColor: a0.theme_color,
|
|
threadMetadata,
|
|
topic_: a0.topic,
|
|
totalMessageSent: a0.total_message_sent,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.UNKNOWN,
|
|
userLimit_: a0.user_limit,
|
|
version: a0.version,
|
|
videoQualityMode: a0.video_quality_mode,
|
|
linkedLobby: a0.linked_lobby,
|
|
hdStreamingUntil: a0.hd_streaming_until,
|
|
hdStreamingBuyerId: a0.hd_streaming_buyer_id,
|
|
voiceHangout: a0.voice_hangout,
|
|
lastNonMessageActivityTimestamp: a0.last_non_message_activity_timestamp
|
|
}, c1145_33);
|
|
}
|
|
}
|
|
UnknownChannelRecord.prototype;
|
|
c1145_33 = UnknownChannelRecord;
|
|
c1145_46 = UnknownChannelRecord;
|
|
c1145_26 = UnknownChannelRecord;
|
|
export class GuildVocalChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
this.application_id = a0.application_id;
|
|
this.bitrate_ = a0.bitrate_;
|
|
this.flags_ = a0.flags_;
|
|
this.iconEmoji = a0.iconEmoji;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.memberListId = a0.memberListId;
|
|
this.nsfw_ = a0.nsfw_;
|
|
this.originChannelId = a0.originChannelId;
|
|
this.parent_id = a0.parent_id;
|
|
let permissionOverwrites_ = a0.permissionOverwrites_;
|
|
if (permissionOverwrites_ == null) {
|
|
permissionOverwrites_ = {};
|
|
}
|
|
this.permissionOverwrites_ = permissionOverwrites_;
|
|
this.position_ = a0.position_;
|
|
this.rateLimitPerUser_ = a0.rateLimitPerUser_;
|
|
this.rtcRegion = a0.rtcRegion;
|
|
this.themeColor = a0.themeColor;
|
|
this.topic_ = a0.topic_;
|
|
this.userLimit_ = a0.userLimit_;
|
|
this.version = a0.version;
|
|
this.videoQualityMode = a0.videoQualityMode;
|
|
this.hdStreamingUntil = a0.hdStreamingUntil;
|
|
this.hdStreamingBuyerId = a0.hdStreamingBuyerId;
|
|
this.voiceHangout = a0.voiceHangout;
|
|
}
|
|
static fromServer(a0, a1) {
|
|
let guild_id = a1 == null ? a0.guild_id : a1;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
const icon_emoji = a0.icon_emoji;
|
|
const iconEmoji = icon_emoji != null ? {
|
|
id: icon_emoji.id,
|
|
name: icon_emoji.name
|
|
} : void 0;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
let nsfw2 = a0.nsfw;
|
|
if (nsfw2 == null) {
|
|
nsfw2 = false;
|
|
}
|
|
let env13008;
|
|
const permission_overwrites = a0.permission_overwrites;
|
|
const r24 = env13008 = {
|
|
$parent: env1145
|
|
};
|
|
const permissionOverwrites_ = {};
|
|
env13008[0] = permissionOverwrites_;
|
|
if (permission_overwrites != null) {
|
|
permission_overwrites.forEach($mk69158(r24));
|
|
}
|
|
let rate_limit_per_user = a0.rate_limit_per_user;
|
|
if (rate_limit_per_user == null) {
|
|
rate_limit_per_user = 0;
|
|
}
|
|
const r7 = {
|
|
application_id: a0.application_id,
|
|
bitrate_: a0.bitrate,
|
|
flags_: a0.flags,
|
|
guild_id,
|
|
iconEmoji,
|
|
id: a0.id,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
memberListId: a0.member_list_id,
|
|
name,
|
|
nsfw_: nsfw2,
|
|
originChannelId: a0.origin_channel_id,
|
|
parent_id: a0.parent_id,
|
|
permissionOverwrites_,
|
|
position_: a0.position,
|
|
rateLimitPerUser_: rate_limit_per_user,
|
|
rtcRegion: a0.rtc_region,
|
|
themeColor: a0.theme_color,
|
|
topic_: a0.topic,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.GUILD_VOICE,
|
|
userLimit_: a0.user_limit,
|
|
version: a0.version,
|
|
videoQualityMode: a0.video_quality_mode,
|
|
hdStreamingUntil: a0.hd_streaming_until,
|
|
hdStreamingBuyerId: a0.hd_streaming_buyer_id,
|
|
voiceHangout: a0.voice_hangout
|
|
};
|
|
let type = r7.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
let r47 = c1145_30[type];
|
|
if (r47 == null) {
|
|
r47 = c1145_26;
|
|
}
|
|
return dangerouslyCast(r7, r47);
|
|
}
|
|
}
|
|
GuildVocalChannelRecord.prototype;
|
|
c1145_44 = GuildVocalChannelRecord;
|
|
export class GuildTextualChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
this.application_id = a0.application_id;
|
|
this.defaultAutoArchiveDuration = a0.defaultAutoArchiveDuration;
|
|
this.defaultThreadRateLimitPerUser = a0.defaultThreadRateLimitPerUser;
|
|
this.flags_ = a0.flags_;
|
|
this.iconEmoji = a0.iconEmoji;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.memberListId = a0.memberListId;
|
|
this.nsfw_ = a0.nsfw_;
|
|
this.parent_id = a0.parent_id;
|
|
let permissionOverwrites_ = a0.permissionOverwrites_;
|
|
if (permissionOverwrites_ == null) {
|
|
permissionOverwrites_ = {};
|
|
}
|
|
this.permissionOverwrites_ = permissionOverwrites_;
|
|
this.position_ = a0.position_;
|
|
this.rateLimitPerUser_ = a0.rateLimitPerUser_;
|
|
this.themeColor = a0.themeColor;
|
|
this.topic_ = a0.topic_;
|
|
this.version = a0.version;
|
|
this.linkedLobby = a0.linkedLobby;
|
|
this.hdStreamingBuyerId = a0.hdStreamingBuyerId;
|
|
this.hdStreamingUntil = a0.hdStreamingUntil;
|
|
}
|
|
static fromServer(a0, a1) {
|
|
let guild_id = a1 == null ? a0.guild_id : a1;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
const icon_emoji = a0.icon_emoji;
|
|
const iconEmoji = icon_emoji != null ? {
|
|
id: icon_emoji.id,
|
|
name: icon_emoji.name
|
|
} : void 0;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
let nsfw2 = a0.nsfw;
|
|
if (nsfw2 == null) {
|
|
nsfw2 = false;
|
|
}
|
|
let env13009;
|
|
const permission_overwrites = a0.permission_overwrites;
|
|
const r24 = env13009 = {
|
|
$parent: env1145
|
|
};
|
|
const permissionOverwrites_ = {};
|
|
env13009[0] = permissionOverwrites_;
|
|
if (permission_overwrites != null) {
|
|
permission_overwrites.forEach($mk69158(r24));
|
|
}
|
|
let rate_limit_per_user = a0.rate_limit_per_user;
|
|
if (rate_limit_per_user == null) {
|
|
rate_limit_per_user = 0;
|
|
}
|
|
const r7 = {
|
|
application_id: a0.application_id,
|
|
defaultAutoArchiveDuration: a0.default_auto_archive_duration,
|
|
defaultThreadRateLimitPerUser: a0.default_thread_rate_limit_per_user,
|
|
flags_: a0.flags,
|
|
guild_id,
|
|
iconEmoji,
|
|
id: a0.id,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
memberListId: a0.member_list_id,
|
|
name,
|
|
nsfw_: nsfw2,
|
|
parent_id: a0.parent_id,
|
|
permissionOverwrites_,
|
|
position_: a0.position,
|
|
rateLimitPerUser_: rate_limit_per_user,
|
|
themeColor: a0.theme_color,
|
|
topic_: a0.topic,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.GUILD_TEXT,
|
|
linkedLobby: a0.linked_lobby,
|
|
hdStreamingUntil: a0.hd_streaming_until,
|
|
hdStreamingBuyerId: a0.hd_streaming_buyer_id,
|
|
version: a0.version
|
|
};
|
|
let type = r7.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
let r44 = c1145_30[type];
|
|
if (r44 == null) {
|
|
r44 = c1145_26;
|
|
}
|
|
return dangerouslyCast(r7, r44);
|
|
}
|
|
}
|
|
GuildTextualChannelRecord.prototype;
|
|
c1145_36 = GuildTextualChannelRecord;
|
|
export class GuildAnnouncementChannelRecord extends GuildTextualChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildAnnouncementChannelRecord.prototype;
|
|
c1145_37 = GuildAnnouncementChannelRecord;
|
|
export class GuildCategoryChannelRecord extends GuildTextualChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildCategoryChannelRecord.prototype;
|
|
c1145_38 = GuildCategoryChannelRecord;
|
|
export class GuildDirectoryChannelRecord extends GuildTextualChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildDirectoryChannelRecord.prototype;
|
|
c1145_39 = GuildDirectoryChannelRecord;
|
|
export class GuildStageVoiceChannelRecord extends GuildVocalChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildStageVoiceChannelRecord.prototype;
|
|
c1145_40 = GuildStageVoiceChannelRecord;
|
|
export class GuildStoreChannelRecord extends GuildTextualChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildStoreChannelRecord.prototype;
|
|
c1145_41 = GuildStoreChannelRecord;
|
|
export class GuildTextChannelRecord extends GuildTextualChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildTextChannelRecord.prototype;
|
|
c1145_42 = GuildTextChannelRecord;
|
|
export class GuildVoiceChannelRecord extends GuildVocalChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GuildVoiceChannelRecord.prototype;
|
|
c1145_43 = GuildVoiceChannelRecord;
|
|
c1145_35 = void 0;
|
|
export class ForumChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
let availableTags = a0.availableTags;
|
|
if (availableTags == null) {
|
|
availableTags = [];
|
|
}
|
|
this.availableTags = availableTags;
|
|
this.defaultAutoArchiveDuration = a0.defaultAutoArchiveDuration;
|
|
this.defaultForumLayout = a0.defaultForumLayout;
|
|
this.defaultReactionEmoji = a0.defaultReactionEmoji;
|
|
this.defaultSortOrder = a0.defaultSortOrder;
|
|
this.defaultTagSetting = a0.defaultTagSetting;
|
|
this.defaultThreadRateLimitPerUser = a0.defaultThreadRateLimitPerUser;
|
|
this.flags_ = a0.flags_;
|
|
this.iconEmoji = a0.iconEmoji;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.memberListId = a0.memberListId;
|
|
this.nsfw_ = a0.nsfw_;
|
|
this.parent_id = a0.parent_id;
|
|
let permissionOverwrites_ = a0.permissionOverwrites_;
|
|
if (permissionOverwrites_ == null) {
|
|
permissionOverwrites_ = {};
|
|
}
|
|
this.permissionOverwrites_ = permissionOverwrites_;
|
|
this.position_ = a0.position_;
|
|
this.rateLimitPerUser_ = a0.rateLimitPerUser_;
|
|
this.template = a0.template;
|
|
this.themeColor = a0.themeColor;
|
|
this.topic_ = a0.topic_;
|
|
this.version = a0.version;
|
|
}
|
|
static fromServer(a0, a1) {
|
|
let availableTags;
|
|
if (a0.available_tags != null) {
|
|
const available_tags = a0.available_tags;
|
|
availableTags = available_tags == null ? [] : available_tags.map($mk69160());
|
|
} else {
|
|
availableTags = [];
|
|
}
|
|
const defaultReactionEmoji = a0.default_reaction_emoji != null ? {
|
|
emojiId: a0.default_reaction_emoji.emoji_id !== 0 ? a0.default_reaction_emoji.emoji_id : void 0,
|
|
emojiName: a0.default_reaction_emoji.emoji_name
|
|
} : void 0;
|
|
let guild_id = a1 == null ? a0.guild_id : a1;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
const icon_emoji = a0.icon_emoji;
|
|
const iconEmoji = icon_emoji != null ? {
|
|
id: icon_emoji.id,
|
|
name: icon_emoji.name
|
|
} : void 0;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
let nsfw2 = a0.nsfw;
|
|
if (nsfw2 == null) {
|
|
nsfw2 = false;
|
|
}
|
|
let env13010;
|
|
const permission_overwrites = a0.permission_overwrites;
|
|
const r43 = env13010 = {
|
|
$parent: env1145
|
|
};
|
|
const permissionOverwrites_ = {};
|
|
env13010[0] = permissionOverwrites_;
|
|
if (permission_overwrites != null) {
|
|
permission_overwrites.forEach($mk69158(r43));
|
|
}
|
|
let rate_limit_per_user = a0.rate_limit_per_user;
|
|
if (rate_limit_per_user == null) {
|
|
rate_limit_per_user = 0;
|
|
}
|
|
return dangerouslyCast({
|
|
availableTags,
|
|
defaultAutoArchiveDuration: a0.default_auto_archive_duration,
|
|
defaultForumLayout: a0.default_forum_layout,
|
|
defaultReactionEmoji,
|
|
defaultSortOrder: a0.default_sort_order,
|
|
defaultTagSetting: a0.default_tag_setting,
|
|
defaultThreadRateLimitPerUser: a0.default_thread_rate_limit_per_user,
|
|
flags_: a0.flags,
|
|
guild_id,
|
|
iconEmoji,
|
|
id: a0.id,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
memberListId: a0.member_list_id,
|
|
name,
|
|
nsfw_: nsfw2,
|
|
parent_id: a0.parent_id,
|
|
permissionOverwrites_,
|
|
position_: a0.position,
|
|
rateLimitPerUser_: rate_limit_per_user,
|
|
template: a0.template,
|
|
themeColor: a0.theme_color,
|
|
topic_: a0.topic,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.GUILD_TEXT,
|
|
version: a0.version
|
|
}, c1145_35);
|
|
}
|
|
}
|
|
ForumChannelRecord.prototype;
|
|
c1145_35 = ForumChannelRecord;
|
|
c1145_45 = ForumChannelRecord;
|
|
class IdAsNumberCache {
|
|
constructor(r5 = 100) {
|
|
this.cache = new LRUCache(r5);
|
|
}
|
|
getOrCompute(a0) {
|
|
const r7 = this.cache.get(a0);
|
|
if (r7 != null) {
|
|
return r7;
|
|
}
|
|
const r11 = parseInt(a0, 10);
|
|
this.cache.set(a0, r11);
|
|
return r11;
|
|
}
|
|
}
|
|
const r537 = {
|
|
__proto__: IdAsNumberCache.prototype
|
|
};
|
|
r537.cache = new LRUCache(100);
|
|
c1145_27 = r537;
|
|
const r546 = {
|
|
__proto__: IdAsNumberCache.prototype
|
|
};
|
|
r546.cache = new LRUCache(100);
|
|
c1145_28 = r546;
|
|
c1145_34 = void 0;
|
|
export class PrivateChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
this.application_id = a0.application_id;
|
|
this.flags_ = a0.flags_;
|
|
this.icon = a0.icon;
|
|
this.isMessageRequest = a0.isMessageRequest;
|
|
this.isMessageRequestTimestamp = a0.isMessageRequestTimestamp;
|
|
this.isSpam = a0.isSpam;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.nicks = a0.nicks;
|
|
this.ownerId = a0.ownerId;
|
|
this.rawRecipients = c1145_34.sortRecipients(a0.rawRecipients, this.id);
|
|
let recipients = a0.recipients;
|
|
if (recipients == null) {
|
|
recipients = [];
|
|
}
|
|
this.recipients = [...recipients].sort(SnowflakeUtils.compare);
|
|
this.recipientFlags = a0.recipientFlags;
|
|
let safetyWarnings = a0.safetyWarnings;
|
|
if (safetyWarnings == null) {
|
|
safetyWarnings = [];
|
|
}
|
|
this.safetyWarnings = safetyWarnings;
|
|
this.blockedUserWarningDismissed = a0.blockedUserWarningDismissed;
|
|
}
|
|
static sortRecipients(a0, a1) {
|
|
let r3 = a0;
|
|
const orCompute = c1145_27.getOrCompute(a1);
|
|
if (a0 == null) {
|
|
r3 = [];
|
|
}
|
|
return [...r3].sort((a, b) => (c1145_28.getOrCompute(a.id) ^ orCompute) - (c1145_28.getOrCompute(b.id) ^ orCompute));
|
|
}
|
|
static fromServer(a0) {
|
|
const rawRecipients = c1145_34.sortRecipients(a0.recipients, a0.id);
|
|
let is_spam = a0.is_spam;
|
|
if (is_spam == null) {
|
|
is_spam = false;
|
|
}
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
const nicks = a0.nicks;
|
|
return dangerouslyCast({
|
|
application_id: a0.application_id,
|
|
flags_: a0.flags,
|
|
guild_id: null,
|
|
icon: a0.icon,
|
|
id: a0.id,
|
|
isMessageRequest: a0.is_message_request,
|
|
isMessageRequestTimestamp: a0.is_message_request_timestamp,
|
|
isSpam: is_spam,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
name,
|
|
nicks: nicks == null ? {} : Module12.reduce(nicks, $mk69159(), {}),
|
|
ownerId: a0.owner_id,
|
|
rawRecipients,
|
|
recipients: rawRecipients.map((rawRecipient) => rawRecipient.id),
|
|
recipientFlags: a0.recipient_flags,
|
|
safetyWarnings: a0.safety_warnings,
|
|
blockedUserWarningDismissed: a0.blocked_user_warning_dismissed,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.DM
|
|
}, c1145_34);
|
|
}
|
|
isSystemDM() {
|
|
const r5 = this.rawRecipients[0];
|
|
return this.type === _Constants.ChannelTypes.DM && r5 != null && r5.system === true;
|
|
}
|
|
getRecipientId() {
|
|
return this.recipients[0];
|
|
}
|
|
addRecipient(a0, a1, a2) {
|
|
if (a0 !== a2) {
|
|
const set2 = this.set;
|
|
let recipients = this.recipients;
|
|
if (recipients == null) {
|
|
recipients = [];
|
|
}
|
|
const r26 = set2.call(this, "recipients", Module12.uniq([...recipients, a0]).sort(SnowflakeUtils.compare));
|
|
let r27 = r26;
|
|
if (a1 != null) {
|
|
const r29 = {
|
|
...r26.nicks
|
|
};
|
|
r29[a0] = a1;
|
|
r27 = r26.set("nicks", r29);
|
|
}
|
|
return r27;
|
|
}
|
|
return this;
|
|
}
|
|
removeRecipient(a0) {
|
|
return this.set("recipients", Module12.without(this.recipients, a0));
|
|
}
|
|
}
|
|
c1145_34 = PrivateChannelRecord;
|
|
c1145_47 = PrivateChannelRecord;
|
|
export class DMChannelRecord extends PrivateChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
DMChannelRecord.prototype;
|
|
c1145_48 = DMChannelRecord;
|
|
export class GroupDMChannelRecord extends PrivateChannelRecord {
|
|
constructor() {
|
|
super(...arguments);
|
|
}
|
|
}
|
|
GroupDMChannelRecord.prototype;
|
|
c1145_49 = GroupDMChannelRecord;
|
|
c1145_32 = void 0;
|
|
export class ThreadChannelRecord extends ChannelRecordBase {
|
|
constructor(a0) {
|
|
super(a0);
|
|
let appliedTags = a0.appliedTags;
|
|
if (appliedTags == null) {
|
|
appliedTags = [];
|
|
}
|
|
this.appliedTags = appliedTags;
|
|
this.bitrate_ = a0.bitrate_;
|
|
this.flags_ = a0.flags_;
|
|
this.lastMessageId = a0.lastMessageId;
|
|
this.lastPinTimestamp = a0.lastPinTimestamp;
|
|
this.member = a0.member;
|
|
this.memberCount = a0.memberCount;
|
|
this.memberIdsPreview = a0.memberIdsPreview;
|
|
this.messageCount = a0.messageCount;
|
|
this.nsfw_ = a0.nsfw_;
|
|
this.ownerId = a0.ownerId;
|
|
this.parent_id = a0.parent_id;
|
|
this.parentChannelThreadType = a0.parentChannelThreadType;
|
|
this.rateLimitPerUser_ = a0.rateLimitPerUser_;
|
|
this.rtcRegion = a0.rtcRegion;
|
|
this.threadMetadata = a0.threadMetadata;
|
|
this.userLimit_ = a0.userLimit_;
|
|
this.videoQualityMode = a0.videoQualityMode;
|
|
this.lastNonMessageActivityTimestamp = a0.lastNonMessageActivityTimestamp;
|
|
}
|
|
static fromServer(a0, a1) {
|
|
let applied_tags = a0.applied_tags;
|
|
if (applied_tags == null) {
|
|
applied_tags = [];
|
|
}
|
|
let guild_id = a1 == null ? a0.guild_id : a1;
|
|
if (guild_id == null) {
|
|
guild_id = null;
|
|
}
|
|
const member = a0.member != null ? {
|
|
flags: a0.member.flags,
|
|
muted: a0.member.muted,
|
|
muteConfig: a0.member.mute_config,
|
|
joinTimestamp: a0.member.join_timestamp
|
|
} : void 0;
|
|
let name = a0.name;
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
let nsfw2 = a0.nsfw;
|
|
if (nsfw2 == null) {
|
|
nsfw2 = false;
|
|
}
|
|
const r34 = a0.thread_metadata != null;
|
|
let threadMetadata = void 0;
|
|
if (r34) {
|
|
let invitable = a0.thread_metadata.invitable;
|
|
if (invitable == null) {
|
|
invitable = true;
|
|
}
|
|
threadMetadata = {
|
|
archived: a0.thread_metadata.archived,
|
|
autoArchiveDuration: a0.thread_metadata.auto_archive_duration,
|
|
archiveTimestamp: a0.thread_metadata.archive_timestamp,
|
|
createTimestamp: a0.thread_metadata.create_timestamp,
|
|
locked: a0.thread_metadata.locked,
|
|
invitable
|
|
};
|
|
}
|
|
return dangerouslyCast({
|
|
appliedTags: applied_tags,
|
|
bitrate_: a0.bitrate,
|
|
flags_: a0.flags,
|
|
guild_id,
|
|
id: a0.id,
|
|
lastMessageId: a0.last_message_id,
|
|
lastPinTimestamp: a0.last_pin_timestamp,
|
|
member,
|
|
memberCount: a0.member_count,
|
|
memberIdsPreview: a0.member_ids_preview,
|
|
messageCount: a0.message_count,
|
|
name,
|
|
nsfw_: nsfw2,
|
|
ownerId: a0.owner_id,
|
|
parent_id: a0.parent_id,
|
|
parentChannelThreadType: a0.parentChannelThreadType,
|
|
rateLimitPerUser_: a0.rate_limit_per_user,
|
|
rtcRegion: a0.rtc_region,
|
|
threadMetadata,
|
|
totalMessageSent: a0.total_message_sent,
|
|
type: a0.type != null ? a0.type : _Constants.ChannelTypes.PUBLIC_THREAD,
|
|
userLimit_: a0.user_limit,
|
|
videoQualityMode: a0.video_quality_mode,
|
|
lastNonMessageActivityTimestamp: a0.last_non_message_activity_timestamp
|
|
}, c1145_32);
|
|
}
|
|
}
|
|
c1145_32 = ThreadChannelRecord;
|
|
c1145_51 = ThreadChannelRecord;
|
|
const r573 = {};
|
|
r573[ChannelTypes2.DM] = PrivateChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GROUP_DM] = PrivateChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_TEXT] = GuildTextualChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_VOICE] = GuildVocalChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_STAGE_VOICE] = GuildVocalChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_CATEGORY] = GuildTextualChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_ANNOUNCEMENT] = GuildTextualChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_STORE] = GuildTextualChannelRecord.fromServer;
|
|
r573[ChannelTypes2.ANNOUNCEMENT_THREAD] = ThreadChannelRecord.fromServer;
|
|
r573[ChannelTypes2.PUBLIC_THREAD] = ThreadChannelRecord.fromServer;
|
|
r573[ChannelTypes2.PRIVATE_THREAD] = ThreadChannelRecord.fromServer;
|
|
r573[ChannelTypes2.MEDIA_THREAD] = ThreadChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_DIRECTORY] = GuildTextualChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_FORUM] = ForumChannelRecord.fromServer;
|
|
r573[ChannelTypes2.GUILD_MEDIA] = ForumChannelRecord.fromServer;
|
|
c1145_29 = r573;
|
|
const r604 = {};
|
|
r604[ChannelTypes2.DM] = DMChannelRecord;
|
|
r604[ChannelTypes2.GROUP_DM] = GroupDMChannelRecord;
|
|
r604[ChannelTypes2.GUILD_TEXT] = GuildTextChannelRecord;
|
|
r604[ChannelTypes2.GUILD_VOICE] = GuildVoiceChannelRecord;
|
|
r604[ChannelTypes2.GUILD_STAGE_VOICE] = GuildStageVoiceChannelRecord;
|
|
r604[ChannelTypes2.GUILD_CATEGORY] = GuildCategoryChannelRecord;
|
|
r604[ChannelTypes2.GUILD_ANNOUNCEMENT] = GuildAnnouncementChannelRecord;
|
|
r604[ChannelTypes2.GUILD_STORE] = GuildStoreChannelRecord;
|
|
r604[ChannelTypes2.ANNOUNCEMENT_THREAD] = ThreadChannelRecord;
|
|
r604[ChannelTypes2.PUBLIC_THREAD] = ThreadChannelRecord;
|
|
r604[ChannelTypes2.PRIVATE_THREAD] = ThreadChannelRecord;
|
|
r604[ChannelTypes2.MEDIA_THREAD] = ThreadChannelRecord;
|
|
r604[ChannelTypes2.GUILD_DIRECTORY] = GuildDirectoryChannelRecord;
|
|
r604[ChannelTypes2.GUILD_FORUM] = ForumChannelRecord;
|
|
r604[ChannelTypes2.GUILD_MEDIA] = ForumChannelRecord;
|
|
c1145_30 = r604;
|
|
export function isGuildSelectableChannelType(a0) {
|
|
return c1145_11.has(a0);
|
|
}
|
|
export { set22 as ALL_CHANNEL_TYPES };
|
|
export function isGuildTextChannelType(a0) {
|
|
return c1145_12.has(a0);
|
|
}
|
|
export { set21 as GUILD_WEBHOOK_CHANNEL_TYPES };
|
|
export { c1145_13 as GUILD_CHANNEL_TYPES };
|
|
export function isGuildChannelType(a0) {
|
|
return c1145_13.has(a0);
|
|
}
|
|
export { set19 as GUILD_CAN_CONTAIN_THREADS_CHANNEL_TYPES };
|
|
export { c1145_14 as GUILD_VOCAL_CHANNEL_TYPES };
|
|
export function isGuildVocalChannelType(a0) {
|
|
return a0 !== "SELECTABLE" && c1145_14.has(a0);
|
|
}
|
|
export function isGuildVocalChannelOrVocalThreadType(a0) {
|
|
return a0 !== "SELECTABLE" && c1145_14.has(a0) || c1145_21.has(a0);
|
|
}
|
|
export { set17 as SILENT_JOIN_LEAVE_CHANNEL_TYPES };
|
|
export function isPrivate(a0) {
|
|
return c1145_15.has(a0);
|
|
}
|
|
export function isMultiUserDM(a0) {
|
|
return c1145_16.has(a0);
|
|
}
|
|
export { c1145_17 as TEXT_CHANNEL_TYPES };
|
|
export function isTextChannel(a0) {
|
|
return c1145_17.has(a0);
|
|
}
|
|
export function isVoiceChannel(a0) {
|
|
return c1145_18.has(a0);
|
|
}
|
|
export function isGuildReadableType(a0) {
|
|
return c1145_19.has(a0);
|
|
}
|
|
export { c1145_20 as THREAD_CHANNEL_TYPES };
|
|
export { c1145_21 as VOCAL_THREAD_CHANNEL_TYPES };
|
|
export { set13 as THREADED_CHANNEL_TYPES };
|
|
export function isThread(a0) {
|
|
return c1145_20.has(a0);
|
|
}
|
|
export function isVocalThreadType(a0) {
|
|
return c1145_21.has(a0);
|
|
}
|
|
export function isReadableType(a0) {
|
|
return c1145_22.has(a0);
|
|
}
|
|
export { set12 as GUILD_NON_CATEGORY_CHANNEL_TYPES };
|
|
export { set11 as EDITABLE_CHANNEL_TYPES };
|
|
export { set10 as TOGGLE_ANNOUNCEMENT_CHANNEL_TYPES };
|
|
export { set9 as TOPIC_CHANNEL_TYPES };
|
|
export { set8 as NSFW_CHANNEL_TYPES };
|
|
export { set7 as CREATEABLE_NON_VOCAL_CHANNEL_NAME_TYPES };
|
|
export { set6 as SLOWMODE_CHANNEL_TYPES };
|
|
export { set5 as EDITABLE_VOICE_SETTINGS_TYPES };
|
|
export { set4 as VOICE_THREAD_PARENT_CHANNEL_TYPES };
|
|
export { set3 as CHANNEL_ELIGIBLE_FOR_UNREAD_SETTING };
|
|
export { set2 as GUILD_FAVORITES_CHANNEL_TYPES };
|
|
export function getAccessPermissions(a0) {
|
|
return a0 !== "SELECTABLE" && c1145_14.has(a0) ? c1145_23 : _Constants.Permissions.VIEW_CHANNEL;
|
|
}
|
|
export function getBasicAccessPermissions(a0) {
|
|
return a0 !== "SELECTABLE" && c1145_14.has(a0) ? c1145_24 : _Constants.BasicPermissions.VIEW_CHANNEL;
|
|
}
|
|
export function createChannelRecordFromServer(a0, a1) {
|
|
let type = a0.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
let r6 = c1145_29[type];
|
|
if (r6 == null) {
|
|
r6 = c1145_26.fromServer;
|
|
}
|
|
return r6(a0, a1);
|
|
}
|
|
export function createChannelRecordFromInvite(a0) {
|
|
return createChannelRecord(a0);
|
|
}
|
|
export function castChannelRecord(a0) {
|
|
let type = a0.type;
|
|
if (type == null) {
|
|
type = _Constants.ChannelTypes.GUILD_TEXT;
|
|
}
|
|
let r6 = c1145_30[type];
|
|
if (r6 == null) {
|
|
r6 = c1145_26;
|
|
}
|
|
return dangerouslyCast(a0, r6);
|
|
}
|