decord/source/stores/GuildAvailabilityStore.tsx

140 lines
4 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 4469
2026-07-24 07:16:23 +00:00
// Function ID: 39485
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1838, 3, 566, 686, 2]
// Module 4469 (_isNativeReflectConstruct)
import timestamp from "timestamp";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import importDefaultResult from "_getPrototypeOf";
import set from "_possibleConstructorReturn";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
2026-07-23 10:11:24 +00:00
let timestamp = !valueOf.call(Reflect.construct(Boolean, [], () => {
2026-07-20 16:05:17 +00:00
}));
function _isNativeReflectConstruct() {
2026-07-23 10:11:24 +00:00
return timestamp;
2026-07-20 16:05:17 +00:00
}
const result = _isNativeReflectConstruct();
}
function handleConnectionOpen(unavailableGuilds) {
const set = new Set(unavailableGuilds.unavailableGuilds);
if (unavailableGuilds.unavailableGuilds.length > 0) {
const _HermesInternal = HermesInternal;
importDefaultResult.warn("" + unavailableGuilds.unavailableGuilds.length + " guilds are unavailable on connection open: " + unavailableGuilds.unavailableGuilds);
}
}
function handleGuild(guild) {
if (set.has(guild.guild.id)) {
set.delete(guild.guild.id);
const _HermesInternal = HermesInternal;
importDefaultResult.info("Guild has become available: " + guild.guild.id);
} else {
return false;
}
}
importDefaultResult = new importDefaultResult("GuildAvailabilityStore");
2026-07-23 10:11:24 +00:00
let set = new Set();
let tmp5 = ((Store) => {
2026-07-20 16:05:17 +00:00
class GuildAvailabilityStore {
constructor() {
self = this;
tmp = GuildAvailabilityStore(this, GuildAvailabilityStore);
2026-07-23 10:11:24 +00:00
obj = outer1_3(GuildAvailabilityStore);
tmp2 = outer1_2;
if (outer1_8()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_3;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_3(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(GuildAvailabilityStore, Store);
let obj = {
key: "initialize",
value() {
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_5);
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , ];
obj = {
key: "isUnavailable",
value(arg0) {
let hasItem = null != arg0;
if (hasItem) {
2026-07-23 10:11:24 +00:00
hasItem = outer1_7.has(arg0);
2026-07-20 16:05:17 +00:00
}
return hasItem;
}
};
items[1] = obj;
obj = {
key: "totalGuilds",
get() {
2026-07-23 10:11:24 +00:00
return outer1_5.getGuildCount() + outer1_7.size;
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "totalUnavailableGuilds",
get() {
2026-07-23 10:11:24 +00:00
return outer1_7.size;
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "unavailableGuilds",
get() {
2026-07-23 10:11:24 +00:00
return Array.from(outer1_7);
2026-07-20 16:05:17 +00:00
}
};
return callback(GuildAvailabilityStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").Store);
2026-07-20 16:05:17 +00:00
tmp5.displayName = "GuildAvailabilityStore";
2026-07-23 10:11:24 +00:00
tmp5 = new tmp5(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: handleConnectionOpen,
OVERLAY_INITIALIZE: handleConnectionOpen,
GUILD_UNAVAILABLE: function handleGuildUnavailable(guildId) {
if (set.has(guildId.guildId)) {
return false;
} else {
2026-07-23 10:11:24 +00:00
guild = guild.getGuild(guildId.guildId);
2026-07-20 16:05:17 +00:00
let str = "???";
if (tmp4) {
str = guild.name;
}
const _HermesInternal = HermesInternal;
importDefaultResult.warn("Guild has gone unavailable: " + guildId.guildId + " (" + str + ")");
set.add(guildId.guildId);
}
},
GUILD_DELETE: function handleGuildDelete(guild) {
if (true !== guild.guild.unavailable) {
set.delete(guild.guild.id);
}
},
GUILD_CREATE: handleGuild,
GUILD_UPDATE: handleGuild,
GUILD_GEO_RESTRICTED: function handleGuildGeoRestrict(guildId) {
if (set.has(guildId.guildId)) {
set.delete(guildId.guildId);
} else {
return false;
}
}
});
2026-07-23 10:11:24 +00:00
let result = set.fileFinishedImporting("stores/GuildAvailabilityStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp5;