decord/source/modules/channel/ChannelMemberCountStore.tsx

76 lines
2.5 KiB
TypeScript
Raw Normal View History

// Module ID: 13375
// Function ID: 13376
// Name: ChannelMemberCountStore
// Dependencies: [5328, 1957, 11, 504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 13375 (ChannelMemberCountStore)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import GatewayConnectionStore from "GatewayConnectionStore" /* 5328 */;
import ChannelStore from "ChannelStore" /* 1957 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let closure_4 = Object.freeze({ online: null, total: null });
let closure_5 = {};
let closure_6 = {};
let closure_7 = null;
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class ChannelMemberCountStore extends PersistedStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = ChannelMemberCountStore.prototype;
prototype["initialize"] = function initialize(arg0) {
let tmp = arg0;
this.waitFor(GatewayConnectionStore, ChannelStore);
2026-07-29 08:29:29 +00:00
if (arg0 == null) {
tmp = closure_5;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
};
prototype["getState"] = function getState() {
return closure_6;
};
prototype["getMemberCount"] = function getMemberCount(arg0) {
let tmp = closure_6[arg0];
2026-07-29 08:29:29 +00:00
if (tmp == null) {
tmp = closure_4;
}
return tmp;
};
prototype["requestCount"] = function requestCount(guild_id, id) {
2026-08-24 06:08:38 +00:00
closure_7 = { guildId: guild_id, channelId: id };
const socket = GatewayConnectionStore.getSocket();
2026-07-29 08:29:29 +00:00
const channelMemberCount = socket.requestChannelMemberCount(guild_id, id);
};
ChannelMemberCountStore.displayName = "ChannelMemberCountStore";
ChannelMemberCountStore.persistKey = "channelMemberCounts";
const channelMemberCountStore = new ChannelMemberCountStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
if (null != closure_7) {
const socket = GatewayConnectionStore.getSocket();
const channelMemberCount = socket.requestChannelMemberCount(closure_7.guildId, closure_7.channelId);
2026-07-20 16:05:17 +00:00
}
const keys = SnowflakeUtilsDefault.keys(closure_6);
const item = keys.forEach((item) => {
if (null == channel.getChannel(item)) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
});
},
CHANNEL_MEMBER_COUNT_UPDATE: function handleMemberCountUpdate(channelId) {
({ online, total } = channelId);
let tmp = null == online;
if (tmp) {
tmp = null == total;
}
if (!tmp) {
const obj = { online, total };
2026-07-29 08:29:29 +00:00
closure_6[channelId.channelId] = obj;
2026-07-20 16:05:17 +00:00
}
return true;
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/ChannelMemberCountStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelMemberCountStore;