decord/source/modules/soundboard/canChannelUseSoundboard.tsx

67 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 5990
// Function ID: 5991
2026-07-20 16:05:17 +00:00
// Name: canChannelUseSoundboard
2026-08-07 06:50:47 +00:00
// Dependencies: [1372, 3929, 1960, 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-08 06:10:11 +00:00
// Module 5990 (canChannelUseSoundboard)
2026-07-29 08:29:29 +00:00
import ensureGuildLoaded from "ensureGuildLoaded";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import handleConnectionOpen from "handleConnectionOpen";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-29 08:29:29 +00:00
({ ChannelTypesSets: c5, Permissions: closure_6 } = ME);
const result = require("handleConnectionOpen").fileFinishedImporting("modules/soundboard/canChannelUseSoundboard.tsx");
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-07-29 08:29:29 +00:00
const canResult = getUncachedChannelPermissions.can(constants2.USE_SOUNDBOARD, type);
const canResult1 = getUncachedChannelPermissions.can(constants2.SPEAK, type);
return type.isGuildVoiceOrThread() && canResult && getUncachedChannelPermissions.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)) {
const canResult = getUncachedChannelPermissions.can(constants2.USE_SOUNDBOARD, channel);
const canResult1 = getUncachedChannelPermissions.can(constants2.SPEAK, channel);
flag = channel.isGuildVoiceOrThread() && canResult && getUncachedChannelPermissions.can(constants2.SPEAK, channel);
const tmp6 = channel.isGuildVoiceOrThread() && canResult && getUncachedChannelPermissions.can(constants2.SPEAK, channel);
}
}
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-07-29 08:29:29 +00:00
const items = [getUncachedChannelPermissions];
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) {
const CALLABLE = outer1_5.CALLABLE;
flag = true;
if (!CALLABLE.has(obj.type)) {
const canResult = outer1_3.can(outer1_6.USE_SOUNDBOARD, obj);
const canResult1 = outer1_3.can(outer1_6.SPEAK, obj);
flag = obj.isGuildVoiceOrThread() && canResult && outer1_3.can(outer1_6.SPEAK, obj);
const tmp6 = obj.isGuildVoiceOrThread() && canResult && outer1_3.can(outer1_6.SPEAK, obj);
}
}
return flag;
}, items1);
2026-07-20 16:05:17 +00:00
};