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

37 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11255
// Function ID: 11256
2026-07-20 16:05:17 +00:00
// Name: getCommandContext
2026-08-11 06:20:06 +00:00
// Dependencies: [19, 1910, 2]
2026-07-29 08:29:29 +00:00
// Exports: getCommandContext, useCommandContext
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 11255 (getCommandContext)
import closure_0 from "noop" /* 19 */;
import closure_1 from "createGuildRecordFromRust" /* 1910 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("modules/app_launcher/hooks/useCommandContext.tsx");
export const getCommandContext = function getCommandContext(type) {
2026-07-20 16:05:17 +00:00
if ("contextless" === type.type) {
2026-08-24 06:08:38 +00:00
let obj = { channel: "Array", guild: "ct" };
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { channel: null, guild: null };
obj[0] = type.channel;
obj[1] = guild.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) {
const React = context;
const items = [context];
2026-07-29 08:29:29 +00:00
return React.useMemo(() => {
if ("contextless" === type.type) {
2026-08-24 06:08:38 +00:00
let obj = { channel: "Array", guild: "ct" };
2026-07-29 08:29:29 +00:00
} else {
obj = { channel: null, guild: null };
obj[0] = tmp.channel;
2026-08-24 06:08:38 +00:00
obj[1] = closure_1_1.getGuild(tmp.channel.guild_id);
2026-07-29 08:29:29 +00:00
}
return obj;
}, items);
2026-07-20 16:05:17 +00:00
};