decord/source/modules/guild_onboarding/DefaultChannelUtils.tsx

57 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5350
// Function ID: 5351
2026-07-29 08:29:29 +00:00
// Name: useCanChannelBeDefault
2026-08-25 06:04:03 +00:00
// Dependencies: [1983, 1391, 676, 506, 589, 4030, 2]
2026-07-20 16:05:17 +00:00
// Exports: canChannelBeDefault, useCanChannelBeDefault
2026-08-25 06:04:03 +00:00
// Module 5350 (useCanChannelBeDefault)
2026-08-24 06:08:38 +00:00
import fromStringAll from "fromString" /* 506 */;
2026-08-25 06:04:03 +00:00
import applyOverwritesAll from "applyOverwrites" /* 4030 */;
import closure_3 from "isSubscriptionGated" /* 1983 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "ensureGuildLoaded" /* 1391 */;
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ ChannelTypesSets: c5, Permissions: closure_6 } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_onboarding/DefaultChannelUtils.tsx");
2026-07-20 16:05:17 +00:00
export const useCanChannelBeDefault = function useCanChannelBeDefault(arg0, arg1) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [closure_3, closure_4];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const channel = closure_1_4.getChannel(callback);
2026-07-29 08:29:29 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
const GUILD_VOCAL = closure_1_5.GUILD_VOCAL;
2026-07-29 08:29:29 +00:00
if (GUILD_VOCAL.has(channel.type)) {
2026-08-24 06:08:38 +00:00
let VIEW_CHANNEL = callback(closure_1_2[3]).combine(closure_1_6.VIEW_CHANNEL, closure_1_6.CONNECT);
const obj = callback(closure_1_2[3]);
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
let isChannelGatedResult = closure_1_3.isChannelGated(closure_0, callback);
2026-07-29 08:29:29 +00:00
if (!isChannelGatedResult) {
2026-08-24 06:08:38 +00:00
isChannelGatedResult = callback(closure_1_2[5]).canEveryoneRole(VIEW_CHANNEL, channel);
const obj2 = callback(closure_1_2[5]);
2026-07-29 08:29:29 +00:00
}
return isChannelGatedResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
VIEW_CHANNEL = closure_1_6.VIEW_CHANNEL;
2026-07-20 16:05:17 +00:00
});
};
export const canChannelBeDefault = function canChannelBeDefault(guild_id, id) {
2026-07-29 08:29:29 +00:00
channel = channel.getChannel(id);
if (null != channel) {
const GUILD_VOCAL = constants.GUILD_VOCAL;
if (GUILD_VOCAL.has(channel.type)) {
2026-08-24 06:08:38 +00:00
let VIEW_CHANNEL = fromStringAll.combine(constants2.VIEW_CHANNEL, constants2.CONNECT);
const obj2 = fromStringAll;
2026-07-29 08:29:29 +00:00
}
let isChannelGatedResult = channelGated.isChannelGated(guild_id, id);
if (!isChannelGatedResult) {
2026-08-24 06:08:38 +00:00
isChannelGatedResult = applyOverwritesAll.canEveryoneRole(VIEW_CHANNEL, channel.getChannel(id));
const obj3 = applyOverwritesAll;
2026-07-29 08:29:29 +00:00
}
return isChannelGatedResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
VIEW_CHANNEL = constants2.VIEW_CHANNEL;
2026-07-20 16:05:17 +00:00
};