decord/source/modules/app_launcher/hooks/useCommandContext.tsx

34 lines
1 KiB
TypeScript
Raw Normal View History

// Module ID: 12121
// Function ID: 12122
// Name: useCommandContext
// Dependencies: [19, 1979, 2]
2026-07-29 08:29:29 +00:00
// Exports: getCommandContext, useCommandContext
2026-07-20 16:05:17 +00:00
// Module 12121 (useCommandContext)
import noop from "module_19" /* 19 */;
import GuildStore from "GuildStore" /* 1979 */;
2026-07-23 10:11:24 +00:00
const size = fn(2);
const result = size.fileFinishedImporting("modules/app_launcher/hooks/useCommandContext.tsx");
2026-07-29 08:29:29 +00:00
export const getCommandContext = function getCommandContext(type) {
2026-07-20 16:05:17 +00:00
if ("contextless" === type.type) {
let obj = { channel: "Array", guild: "PX_16" };
2026-07-20 16:05:17 +00:00
} else {
obj = { channel: type.channel, guild: GuildStore.getGuild(type.channel.guild_id) };
2026-07-20 16:05:17 +00:00
}
return obj;
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useCommandContext = function useCommandContext(context) {
noop = context;
2026-07-20 16:05:17 +00:00
const items = [context];
return noop.useMemo(() => {
2026-07-29 08:29:29 +00:00
if ("contextless" === type.type) {
let obj = { channel: "Array", guild: "PX_16" };
2026-07-29 08:29:29 +00:00
} else {
obj = { channel: tmp.channel, guild: GuildStore.getGuild(tmp.channel.guild_id) };
2026-07-29 08:29:29 +00:00
}
return obj;
}, items);
2026-07-20 16:05:17 +00:00
};