decord/source/modules/soundboard/canChannelUseSoundboard.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

67 lines
2.6 KiB
TypeScript

// Module ID: 7478
// Function ID: 7479
// Name: canChannelUseSoundboard
// Dependencies: [1957, 4275, 2011, 1074, 504, 2]
// Exports: canSelectedVoiceChannelUseSoundboard, default, useCanChannelUseSoundboard
// Module 7478 (canChannelUseSoundboard)
import ChannelStore from "ChannelStore" /* 1957 */;
import PermissionStore from "PermissionStore" /* 4275 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
const require = globalThis.__r;
const require = fn;
const Constants = fn(1074);
({ ChannelTypesSets: hasOwnProperty, Permissions: metroRequire } = Constants);
const size = fn(2);
const result = size.fileFinishedImporting("modules/soundboard/canChannelUseSoundboard.tsx");
export default function canChannelUseSoundboard(type) {
if (null == type) {
return false;
} else {
const CALLABLE = constants.CALLABLE;
if (CALLABLE.has(type.type)) {
return true;
} else {
const canResult = PermissionStore.can(constants2.USE_SOUNDBOARD, type);
const canResult1 = PermissionStore.can(constants2.SPEAK, type);
return type.isGuildVoiceOrThread() && canResult && PermissionStore.can(constants2.SPEAK, type);
}
}
};
export const canSelectedVoiceChannelUseSoundboard = function canSelectedVoiceChannelUseSoundboard() {
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
let flag = false;
if (null != channel) {
const CALLABLE = constants.CALLABLE;
flag = true;
if (!CALLABLE.has(channel.type)) {
const canResult = PermissionStore.can(constants2.USE_SOUNDBOARD, channel);
const canResult1 = PermissionStore.can(constants2.SPEAK, channel);
flag = channel.isGuildVoiceOrThread() && canResult && PermissionStore.can(constants2.SPEAK, channel);
const tmp6 = channel.isGuildVoiceOrThread() && canResult && PermissionStore.can(constants2.SPEAK, channel);
}
}
return flag;
};
export const useCanChannelUseSoundboard = function useCanChannelUseSoundboard(arg0) {
_require = arg0;
const items = [PermissionStore];
const items1 = [arg0];
return require("initialize").useStateFromStores(items, () => {
let flag = false;
if (null != closure_0) {
const CALLABLE = constants.CALLABLE;
flag = true;
if (!CALLABLE.has(obj.type)) {
const canResult = PermissionStore.can(constants2.USE_SOUNDBOARD, obj);
const canResult1 = PermissionStore.can(constants2.SPEAK, obj);
flag = obj.isGuildVoiceOrThread() && canResult && PermissionStore.can(constants2.SPEAK, obj);
const tmp6 = obj.isGuildVoiceOrThread() && canResult && PermissionStore.can(constants2.SPEAK, obj);
}
}
return flag;
}, items1);
};