decord/source/modules/app_launcher/hooks/useCommandContext.tsx
github-actions 7450227d0b chore: update source for alpha 345.4
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9596_m.js (380.6 MB)
2026-09-04 17:41:35 +00:00

36 lines
1.1 KiB
TypeScript

// Module ID: 11960
// Function ID: 11961
// Name: getCommandContext
// Dependencies: [19, 1908, 2]
// Exports: getCommandContext, useCommandContext
// Module 11960 (getCommandContext)
import closure_0 from "noop" /* 19 */;
import closure_1 from "createGuildRecordFromRust" /* 1908 */;
const result = require("set").fileFinishedImporting("modules/app_launcher/hooks/useCommandContext.tsx");
export const getCommandContext = function getCommandContext(type) {
if ("contextless" === type.type) {
let obj = { channel: "left", guild: "call" };
} else {
obj = { channel: null, guild: null };
obj[0] = type.channel;
obj[1] = guild.getGuild(type.channel.guild_id);
}
return obj;
};
export const useCommandContext = function useCommandContext(context) {
const React = context;
const items = [context];
return React.useMemo(() => {
if ("contextless" === type.type) {
let obj = { channel: "left", guild: "call" };
} else {
obj = { channel: null, guild: null };
obj[0] = tmp.channel;
obj[1] = closure_1_1.getGuild(tmp.channel.guild_id);
}
return obj;
}, items);
};