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

37 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 11206
// Function ID: 11207
2026-07-20 16:05:17 +00:00
// Name: getCommandContext
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 1862, 2]
// Exports: getCommandContext, useCommandContext
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 11206 (getCommandContext)
import noop from "noop";
import createGuildRecordFromRust from "createGuildRecordFromRust";
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-07-29 08:29:29 +00:00
let obj = { channel: "dispatch", guild: "isArray" };
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) {
let obj = { channel: "dispatch", guild: "isArray" };
} else {
obj = { channel: null, guild: null };
obj[0] = tmp.channel;
obj[1] = outer1_1.getGuild(tmp.channel.guild_id);
}
return obj;
}, items);
2026-07-20 16:05:17 +00:00
};