decord/source/modules/soundboard/canChannelUseSoundboard.tsx

65 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7373
// Function ID: 7374
2026-07-20 16:05:17 +00:00
// Name: canChannelUseSoundboard
2026-08-24 06:08:38 +00:00
// Dependencies: [1391, 4024, 1980, 676, 589, 2]
2026-07-29 08:29:29 +00:00
// Exports: canSelectedVoiceChannelUseSoundboard, default, useCanChannelUseSoundboard
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 7373 (canChannelUseSoundboard)
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import closure_3 from "getUncachedChannelPermissions" /* 4024 */;
import closure_4 from "handleConnectionOpen" /* 1980 */;
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ ChannelTypesSets: c5, Permissions: closure_6 } = ME);
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/soundboard/canChannelUseSoundboard.tsx");
2026-07-29 08:29:29 +00:00
export default function canChannelUseSoundboard(type) {
if (null == type) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const CALLABLE = constants.CALLABLE;
2026-07-29 08:29:29 +00:00
if (CALLABLE.has(type.type)) {
2026-07-20 16:05:17 +00:00
return true;
} else {
2026-08-24 06:08:38 +00:00
const canResult = closure_3.can(constants2.USE_SOUNDBOARD, type);
const canResult1 = closure_3.can(constants2.SPEAK, type);
return type.isGuildVoiceOrThread() && canResult && closure_3.can(constants2.SPEAK, type);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const canSelectedVoiceChannelUseSoundboard = function canSelectedVoiceChannelUseSoundboard() {
2026-07-29 08:29:29 +00:00
channel = channel.getChannel(voiceChannelId.getVoiceChannelId());
let flag = false;
if (null != channel) {
const CALLABLE = constants.CALLABLE;
flag = true;
if (!CALLABLE.has(channel.type)) {
2026-08-24 06:08:38 +00:00
const canResult = closure_3.can(constants2.USE_SOUNDBOARD, channel);
const canResult1 = closure_3.can(constants2.SPEAK, channel);
flag = channel.isGuildVoiceOrThread() && canResult && closure_3.can(constants2.SPEAK, channel);
const tmp6 = channel.isGuildVoiceOrThread() && canResult && closure_3.can(constants2.SPEAK, channel);
2026-07-29 08:29:29 +00:00
}
}
return flag;
2026-07-20 16:05:17 +00:00
};
export const useCanChannelUseSoundboard = function useCanChannelUseSoundboard(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_3];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => {
let flag = false;
if (null != closure_0) {
2026-08-24 06:08:38 +00:00
const CALLABLE = closure_1_5.CALLABLE;
2026-07-29 08:29:29 +00:00
flag = true;
if (!CALLABLE.has(obj.type)) {
2026-08-24 06:08:38 +00:00
const canResult = closure_1_3.can(closure_1_6.USE_SOUNDBOARD, obj);
const canResult1 = closure_1_3.can(closure_1_6.SPEAK, obj);
flag = obj.isGuildVoiceOrThread() && canResult && closure_1_3.can(closure_1_6.SPEAK, obj);
const tmp6 = obj.isGuildVoiceOrThread() && canResult && closure_1_3.can(closure_1_6.SPEAK, obj);
2026-07-29 08:29:29 +00:00
}
}
return flag;
}, items1);
2026-07-20 16:05:17 +00:00
};