decord/alpha/source/modules/guild/usePostableChannelCount.tsx
github-actions 1224ea86fd chore: update source for alpha 348.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
2026-09-26 08:31:33 +00:00

36 lines
1.2 KiB
TypeScript

// Module ID: 16564
// Function ID: 16565
// Name: usePostableChannelCount
// Dependencies: [4467, 4469, 1074, 504, 1086, 2]
// Exports: default
// Module 16564 (usePostableChannelCount)
import BigFlagUtilsAll from "BigFlagUtils" /* 1086 */;
import GuildChannelStore from "GuildChannelStore" /* 4467 */;
import PermissionStore from "PermissionStore" /* 4469 */;
const require = globalThis.__r;
const require = fn;
let closure_4 = fn(4467).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;
};