decord/alpha/source/modules/guild/usePostableChannelCount.tsx
github-actions 52331fb8ae chore: update source for alpha 349.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
2026-09-30 07:29:52 +00:00

36 lines
1.2 KiB
TypeScript

// Module ID: 16792
// Function ID: 16793
// Name: usePostableChannelCount
// Dependencies: [4497, 4499, 1074, 504, 1086, 2]
// Exports: default
// Module 16792 (usePostableChannelCount)
import BigFlagUtilsAll from "BigFlagUtils" /* 1086 */;
import GuildChannelStore from "GuildChannelStore" /* 4497 */;
import PermissionStore from "PermissionStore" /* 4499 */;
const require = globalThis.__r;
const require = fn;
let closure_4 = fn(4497).GUILD_SELECTABLE_CHANNELS_KEY;
const Permissions = fn(1074).Permissions;
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild/usePostableChannelCount.tsx");
export default function useSendMessageChannelCount(arg0) {
_require = arg0;
let items = [GuildChannelStore];
const items1 = [arg0];
const stateFromStores = require("initialize").useStateFromStores(items, () => {
let items = GuildChannelStore.getChannels(closure_0)[closure_4];
if (items == null) {
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;
}
return num;
};