decord/source/modules/video_calls/useChannelVideoLimit.tsx

44 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 8842
// Function ID: 69727
2026-07-20 16:05:17 +00:00
// Name: useChannelVideoLimit
2026-07-23 10:11:24 +00:00
// Dependencies: [1838, 4203, 653, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChannelVideoLimit
2026-07-23 10:11:24 +00:00
// Module 8842 (useChannelVideoLimit)
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { ChannelTypes } from "ME";
const require = arg1;
let result = require("ME").fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
2026-07-20 16:05:17 +00:00
export default function useChannelVideoLimit(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
const items = [_isNativeReflectConstruct, _createForOfIteratorHelperLoose];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-23 10:11:24 +00:00
return _require(566).useStateFromStoresObject(items, () => {
const result = outer1_3.countVoiceStatesForChannel(guildId.id);
const guild = outer1_2.getGuild(guildId.getGuildId());
2026-07-20 16:05:17 +00:00
if (null == guild) {
2026-07-23 10:11:24 +00:00
let obj = { reachedLimit: false, limit: -1 };
} else if (guildId.type === outer1_4.GUILD_STAGE_VOICE) {
2026-07-20 16:05:17 +00:00
obj = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
}
return obj;
}, items1);
};
export const getChannelVideoLimit = function getChannelVideoLimit(channel) {
2026-07-23 10:11:24 +00:00
const result = _isNativeReflectConstruct.countVoiceStatesForChannel(channel.id);
guild = guild.getGuild(channel.getGuildId());
2026-07-20 16:05:17 +00:00
if (null == guild) {
2026-07-23 10:11:24 +00:00
let obj = { reachedLimit: false, limit: -1 };
2026-07-20 16:05:17 +00:00
} else if (channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
obj = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
}
return obj;
};