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

27 lines
835 B
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 11152
// Function ID: 86712
2026-07-20 16:05:17 +00:00
// Name: getCommandContext
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 1838, 2]
2026-07-20 16:05:17 +00:00
// Exports: useCommandContext
2026-07-23 10:11:24 +00:00
// Module 11152 (getCommandContext)
import result from "result";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
2026-07-20 16:05:17 +00:00
function getCommandContext(type) {
if ("contextless" === type.type) {
let obj = { channel: undefined, guild: undefined };
} else {
obj = { channel: type.channel, guild: guild.getGuild(type.channel.guild_id) };
}
return obj;
}
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/app_launcher/hooks/useCommandContext.tsx");
2026-07-20 16:05:17 +00:00
export { getCommandContext };
export const useCommandContext = function useCommandContext(context) {
const React = context;
const items = [context];
2026-07-23 10:11:24 +00:00
return React.useMemo(() => outer1_2(result), items);
2026-07-20 16:05:17 +00:00
};