decord/source/modules/video_calls/useChannelVideoLimit.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

53 lines
2.2 KiB
TypeScript

// Module ID: 9093
// Function ID: 9094
// Name: useChannelVideoLimit
// Dependencies: [1979, 4584, 1074, 504, 2]
// Exports: default, getChannelVideoLimit
// Module 9093 (useChannelVideoLimit)
import closure_2 from "createGuildRecordFromRust" /* 1979 */;
import closure_3 from "getVoiceStatesForGuild" /* 4584 */;
import { ChannelTypes } from "ME" /* 1074 */;
const require = arg1;
let result = require("set").fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
export default function useChannelVideoLimit(arg0) {
const _require = arg0;
const items = [closure_3, closure_2];
const items1 = [arg0];
return _require(504).useStateFromStoresObject(items, () => {
const result = closure_1_3.countVoiceStatesForChannel(guildId.id);
const guild = closure_1_2.getGuild(guildId.getGuildId());
if (null == guild) {
let obj = { reachedLimit: false, limit: -1 };
} else if (guildId.type === closure_1_4.GUILD_STAGE_VOICE) {
obj = { reachedLimit: null, limit: null };
obj[0] = result > guild.maxStageVideoChannelUsers;
obj[1] = guild.maxStageVideoChannelUsers;
} else {
obj = { reachedLimit: null, limit: null };
obj[0] = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
obj[1] = guild.maxVideoChannelUsers;
const tmp5 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
}
return obj;
}, items1);
};
export const getChannelVideoLimit = function getChannelVideoLimit(channel) {
const result = closure_3.countVoiceStatesForChannel(channel.id);
guild = guild.getGuild(channel.getGuildId());
if (null == guild) {
let obj = { reachedLimit: false, limit: -1 };
} else if (channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
obj = { reachedLimit: null, limit: null };
obj[0] = result > guild.maxStageVideoChannelUsers;
obj[1] = guild.maxStageVideoChannelUsers;
} else {
obj = { reachedLimit: null, limit: null };
obj[0] = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
obj[1] = guild.maxVideoChannelUsers;
const tmp4 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
}
return obj;
};