decord/source/modules/channel/ChannelStatusStore.tsx
2026-08-08 06:10:11 +00:00

71 lines
2.1 KiB
TypeScript

// Module ID: 6988
// Function ID: 6989
// Name: handleConnectionReset
// Dependencies: [4994, 589, 692, 709, 2]
// Module 6988 (handleConnectionReset)
import _handleConnectionOpen from "_handleConnectionOpen";
import { Store } from "initialize";
import set from "set";
const require = arg1;
function handleConnectionReset() {
set.clear();
}
function handleGuildReset(guild) {
set.delete(guild.guild.id);
}
let set = new Set();
let closure_4 = {};
class ChannelStatusStore extends Store {
}
const prototype = ChannelStatusStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(_handleConnectionOpen);
};
prototype["getChannelStatus"] = function getChannelStatus(guild_id) {
if (null != guild_id) {
if (null != guild_id.guild_id) {
if (guild_id.type === require(692) /* set */.ChannelTypes.GUILD_VOICE) {
let tmp5;
if (dependencyMap[guild_id.guild_id] != null) {
tmp5 = tmp4[guild_id.id];
}
return tmp5;
}
}
}
};
prototype["hasRequestedStatuses"] = function hasRequestedStatuses(guild_id) {
return set.has(guild_id);
};
ChannelStatusStore.displayName = "ChannelStatusStore";
const channelStatusStore = new ChannelStatusStore(require("dispatcher"), {
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_STATUS_UPDATE: function handleVoiceChannelStatusUpdate(guildId) {
if (null == dependencyMap[guildId.guildId]) {
tmp[guildId.guildId] = {};
}
dependencyMap[guildId.guildId][guildId.id] = guildId.status;
},
CHANNEL_INFO: function handleChannelInfo(arg0) {
let channels;
let guildId;
({ guildId, channels } = arg0);
dependencyMap[guildId] = {};
for (const item10009 of channels) {
let tmp = dependencyMap;
dependencyMap[guildId][item10009.id] = item10009.status;
continue;
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(guildId) {
set.add(guildId.guildId);
}
});
const result = set.fileFinishedImporting("modules/channel/ChannelStatusStore.tsx");
export default channelStatusStore;