decord/source/modules/soundboard/useCustomJoinSound.tsx

82 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 6228
// Function ID: 6229
2026-07-29 08:29:29 +00:00
// Name: CustomSoundType
2026-09-03 10:05:34 +00:00
// Dependencies: [1339, 4968, 586, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCustomJoinSound, useCustomJoinSound
2026-09-03 10:05:34 +00:00
// Module 6228 (CustomSoundType)
2026-09-02 09:53:35 +00:00
import closure_2 from "handleConnectionClosedOrResumed" /* 1339 */;
2026-09-03 10:05:34 +00:00
import { CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID as closure_3 } from "MAX_LENGTH_SOUND_NAME" /* 4968 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
let obj = { GLOBAL: 0, [0]: "GLOBAL", GUILD: 1, [1]: "GUILD" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/soundboard/useCustomJoinSound.tsx");
2026-07-20 16:05:17 +00:00
export const CustomSoundType = obj;
export const useCustomJoinSound = function useCustomJoinSound(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_2];
2026-09-02 09:53:35 +00:00
return _require(586).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
let guilds = closure_1_2.settings.guilds;
2026-07-20 16:05:17 +00:00
guilds = undefined;
2026-07-29 08:29:29 +00:00
if (guilds != null) {
2026-07-20 16:05:17 +00:00
guilds = guilds.guilds;
}
2026-07-29 08:29:29 +00:00
if (guilds == null) {
2026-07-20 16:05:17 +00:00
guilds = {};
}
2026-07-29 08:29:29 +00:00
let joinSound;
if (guilds[closure_0] != null) {
joinSound = tmp.joinSound;
}
2026-08-24 06:08:38 +00:00
if (guilds[closure_1_3] != null) {
2026-07-29 08:29:29 +00:00
joinSound = tmp3.joinSound;
}
let tmp4 = joinSound;
if (joinSound == null) {
tmp4 = joinSound;
}
if (null != tmp4) {
2026-08-24 06:08:38 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp4);
if (null != joinSound) {
2026-08-24 06:08:38 +00:00
let GLOBAL = closure_1_4.GUILD;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
GLOBAL = closure_1_4.GLOBAL;
2026-07-29 08:29:29 +00:00
}
obj.type = GLOBAL;
}
2026-07-20 16:05:17 +00:00
});
};
2026-07-29 08:29:29 +00:00
export const getCustomJoinSound = function getCustomJoinSound(currentUser) {
2026-07-20 16:05:17 +00:00
let guilds = settings.settings.guilds;
guilds = undefined;
2026-07-29 08:29:29 +00:00
if (guilds != null) {
2026-07-20 16:05:17 +00:00
guilds = guilds.guilds;
}
2026-07-29 08:29:29 +00:00
if (guilds == null) {
2026-07-20 16:05:17 +00:00
guilds = {};
}
2026-07-29 08:29:29 +00:00
let joinSound;
if (guilds[currentUser] != null) {
joinSound = tmp.joinSound;
}
if (guilds[closure_3] != null) {
joinSound = tmp3.joinSound;
}
let tmp4 = joinSound;
if (joinSound == null) {
tmp4 = joinSound;
}
if (null != tmp4) {
2026-08-24 06:08:38 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp4);
if (null != joinSound) {
let GLOBAL = obj.GUILD;
} else {
GLOBAL = obj.GLOBAL;
}
obj.type = GLOBAL;
}
2026-07-20 16:05:17 +00:00
};