decord/alpha/source/modules/channel/VoiceChannelStartTimeStore.tsx

101 lines
3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 9579
// Function ID: 9580
// Name: VoiceChannelStartTimeStore
2026-10-09 10:00:15 +00:00
// Dependencies: [5754, 1102, 504, 1106, 584, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 9579 (VoiceChannelStartTimeStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
import DurationsDefault from "Durations" /* 1102 */;
import ChannelTypes from "ChannelTypes" /* 1106 */;
2026-10-09 10:00:15 +00:00
import GatewayConnectionStore from "GatewayConnectionStore" /* 5754 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
function _toTimestampMs(arg0) {
2026-10-03 08:58:59 +00:00
const date = new Date(arg0 * DurationsDefault.Millis.SECOND);
return date.getTime();
2026-07-20 16:05:17 +00:00
}
function handleConnectionReset() {
set.clear();
}
function handleGuildReset(guild) {
set.delete(guild.guild.id);
}
const set = new Set();
2026-10-03 08:58:59 +00:00
const hasOwnProperty = {};
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class VoiceChannelStartTimeStore extends Store {
2026-10-03 08:58:59 +00:00
initialize() {
this.waitFor(GatewayConnectionStore);
}
getStartTime(guild_id) {
if (null != guild_id) {
if (null != guild_id.guild_id) {
if (guild_id.type === ChannelTypes.ChannelTypes.GUILD_VOICE) {
let tmp5;
if (closure_5[guild_id.guild_id] != null) {
tmp5 = tmp4[guild_id.id];
}
return tmp5;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
hasRequestedStartTimes(guild_id) {
return set.has(guild_id);
}
}
const prototype = VoiceChannelStartTimeStore.prototype;
2026-07-29 08:29:29 +00:00
VoiceChannelStartTimeStore.displayName = "VoiceChannelStartTimeStore";
2026-10-03 08:58:59 +00:00
const obj = {
2026-07-20 16:05:17 +00:00
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_START_TIME_UPDATE: function handleVoiceChannelStartTimeUpdate(id) {
2026-10-03 08:58:59 +00:00
let guildId;
let voiceStartTime;
2026-07-20 16:05:17 +00:00
({ guildId, voiceStartTime } = id);
2026-10-03 08:58:59 +00:00
id = id.id;
if (null == closure_5[guildId]) {
closure_5[guildId] = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let time;
2026-10-03 08:58:59 +00:00
const tmp2 = closure_5[guildId];
2026-07-20 16:05:17 +00:00
if (null != voiceStartTime) {
2026-07-29 08:29:29 +00:00
const _Date = Date;
2026-10-03 08:58:59 +00:00
const self = this;
const self2 = this;
const date = new Date(voiceStartTime * DurationsDefault.Millis.SECOND);
2026-07-29 08:29:29 +00:00
time = date.getTime();
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp2[id] = time;
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
CHANNEL_INFO: function handleStartTimes(arg0) {
2026-10-03 08:58:59 +00:00
let channels;
let guildId;
2026-07-29 08:29:29 +00:00
({ guildId, channels } = arg0);
2026-10-03 08:58:59 +00:00
closure_5[guildId] = {};
2026-07-29 08:29:29 +00:00
const iter = channels[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let voiceStartTime = nextResult.voiceStartTime;
2026-10-03 08:58:59 +00:00
let tmp5;
let id = nextResult.id;
let tmp4 = closure_5[guildId];
2026-07-29 08:29:29 +00:00
if (null != voiceStartTime) {
2026-10-03 08:58:59 +00:00
tmp5 = _toTimestampMs(tmp2);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp4[id] = tmp5;
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(guildId) {
set.add(guildId.guildId);
}
2026-10-03 08:58:59 +00:00
};
const voiceChannelStartTimeStore = new VoiceChannelStartTimeStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("modules/channel/VoiceChannelStartTimeStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default voiceChannelStartTimeStore;