decord/stable/source/modules/channel/VoiceChannelStartTimeStore.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

89 lines
2.9 KiB
TypeScript

// Module ID: 11445
// Function ID: 11446
// Name: VoiceChannelStartTimeStore
// Dependencies: [5358, 1090, 504, 1094, 573, 2]
// Module 11445 (VoiceChannelStartTimeStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import DurationsDefault from "Durations" /* 1090 */;
import ChannelTypes from "ChannelTypes" /* 1094 */;
import GatewayConnectionStore from "GatewayConnectionStore" /* 5358 */;
require = fn;
function _toTimestampMs(arg0) {
return new Date(arg0 * DurationsDefault.Millis.SECOND).getTime();
}
function handleConnectionReset() {
set.clear();
}
function handleGuildReset(guild) {
set.delete(guild.guild.id);
}
const set = new Set();
const dependencyMap = {};
const Store = initializeDefault.Store;
class VoiceChannelStartTimeStore extends Store {
}
const prototype = VoiceChannelStartTimeStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(GatewayConnectionStore);
};
prototype["getStartTime"] = function getStartTime(guild_id) {
if (null != guild_id) {
if (null != guild_id.guild_id) {
if (guild_id.type === ChannelTypes.ChannelTypes.GUILD_VOICE) {
let tmp5;
if (dependencyMap[guild_id.guild_id] != null) {
tmp5 = tmp4[guild_id.id];
}
return tmp5;
}
}
}
};
prototype["hasRequestedStartTimes"] = function hasRequestedStartTimes(guild_id) {
return set.has(guild_id);
};
VoiceChannelStartTimeStore.displayName = "VoiceChannelStartTimeStore";
const voiceChannelStartTimeStore = new VoiceChannelStartTimeStore(DispatcherDefault, {
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_START_TIME_UPDATE: function handleVoiceChannelStartTimeUpdate(id) {
({ guildId, voiceStartTime } = id);
if (null == dependencyMap[guildId]) {
tmp[guildId] = {};
}
let time;
if (null != voiceStartTime) {
const _Date = Date;
const date = new Date(voiceStartTime * DurationsDefault.Millis.SECOND);
time = date.getTime();
}
dependencyMap[guildId][id.id] = time;
},
CHANNEL_INFO: function handleStartTimes(arg0) {
({ guildId, channels } = arg0);
dependencyMap[guildId] = {};
const iter = channels[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let voiceStartTime = nextResult.voiceStartTime;
let tmp4;
if (null != voiceStartTime) {
tmp4 = _toTimestampMs(tmp2);
}
dependencyMap[guildId][nextResult.id] = tmp4;
continue;
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(guildId) {
set.add(guildId.guildId);
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/VoiceChannelStartTimeStore.tsx");
export default voiceChannelStartTimeStore;