decord/source/modules/guild/usePostableChannelCount.tsx

37 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 16989
// Function ID: 16990
// Name: usePostableChannelCount
// Dependencies: [2013, 4278, 1074, 504, 1086, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 16989 (usePostableChannelCount)
import BigFlagUtilsAll from "BigFlagUtils" /* 1086 */;
import GuildChannelStore from "GuildChannelStore" /* 2013 */;
import PermissionStore from "PermissionStore" /* 4278 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
let closure_4 = fn(2013).GUILD_SELECTABLE_CHANNELS_KEY;
const Permissions = fn(1074).Permissions;
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild/usePostableChannelCount.tsx");
2026-07-20 16:05:17 +00:00
export default function useSendMessageChannelCount(arg0) {
_require = arg0;
let items = [GuildChannelStore];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
const stateFromStores = require("initialize").useStateFromStores(items, () => {
let items = GuildChannelStore.getChannels(closure_0)[closure_4];
2026-07-29 08:29:29 +00:00
if (items == null) {
2026-07-20 16:05:17 +00:00
items = [];
}
return items;
}, items1);
let num = 0;
if (0 !== stateFromStores.length) {
num = stateFromStores.filter((channel) => PermissionStore.can(BigFlagUtilsAll.combine(constants.SEND_MESSAGES, constants.VIEW_CHANNEL), channel.channel)).length;
2026-07-20 16:05:17 +00:00
}
return num;
};