decord/alpha/source/modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx

44 lines
1.4 KiB
TypeScript
Raw Normal View History

// Module ID: 16319
// Function ID: 16320
2026-07-29 08:29:29 +00:00
// Name: useFirstGloballyViewbleGuildChannelId
// Dependencies: [2013, 1085, 504, 4366, 2]
2026-07-20 16:05:17 +00:00
// Exports: useFirstGloballyViewbleGuildChannelId
// Module 16319 (useFirstGloballyViewbleGuildChannelId)
import PermissionUtilsAll from "PermissionUtils" /* 4366 */;
import GuildChannelStore from "GuildChannelStore" /* 2013 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const Permissions = fn(1085).Permissions;
const size = fn(2);
const result = size.fileFinishedImporting("modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx");
2026-07-20 16:05:17 +00:00
export const useFirstGloballyViewbleGuildChannelId = function useFirstGloballyViewbleGuildChannelId(guildId) {
_require = guildId;
const items = [GuildChannelStore];
2026-07-20 16:05:17 +00:00
const items1 = [guildId];
return require("initialize").useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
if (null != closure_0) {
const selectableChannels = GuildChannelStore.getSelectableChannels(tmp);
2026-07-29 08:29:29 +00:00
for (const item10010 of selectableChannels) {
let channel = item10010.channel;
let obj2 = PermissionUtilsAll;
if (obj2.canEveryone(Permissions.VIEW_CHANNEL, channel)) {
2026-07-29 08:29:29 +00:00
obj.return();
return channel.id;
2026-07-20 16:05:17 +00:00
}
}
let id;
2026-07-29 08:29:29 +00:00
if (selectableChannels != null) {
2026-07-20 16:05:17 +00:00
const first = selectableChannels[0];
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
id = first.channel.id;
}
}
return id;
}
}, items1);
};