decord/alpha/source/modules/video_calls/useChannelVideoLimit.tsx
github-actions 6eea20b8e1 chore: update source for alpha 348.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-24 10:59:02 +00:00

50 lines
2.1 KiB
TypeScript

// Module ID: 9994
// Function ID: 9995
// Name: useChannelVideoLimit
// Dependencies: [2066, 4853, 1074, 504, 2]
// Exports: default, getChannelVideoLimit
// Module 9994 (useChannelVideoLimit)
import GuildStore from "GuildStore" /* 2066 */;
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4853 */;
const require = globalThis.__r;
const require = fn;
const ChannelTypes = fn(1074).ChannelTypes;
const size = fn(2);
let result = size.fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
export default function useChannelVideoLimit(arg0) {
_require = arg0;
const items = [SortedVoiceStateStore, GuildStore];
const items1 = [arg0];
return require("initialize").useStateFromStoresObject(items, () => {
const result = SortedVoiceStateStore.countVoiceStatesForChannel(guildId.id);
const guild = GuildStore.getGuild(guildId.getGuildId());
if (null == guild) {
let obj = { reachedLimit: false, limit: -1 };
} else if (guildId.type === ChannelTypes.GUILD_STAGE_VOICE) {
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
obj = obj2;
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
const tmp5 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
}
return obj;
}, items1);
};
export const getChannelVideoLimit = function getChannelVideoLimit(channel) {
const result = SortedVoiceStateStore.countVoiceStatesForChannel(channel.id);
const guild = GuildStore.getGuild(channel.getGuildId());
if (null == guild) {
let obj = { reachedLimit: false, limit: -1 };
} else if (channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
obj = obj2;
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
const tmp4 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
}
return obj;
};