Files
discord-decomp/modules/app_launcher/hooks/useCommandContext.tsx
T
2026-11-01 12:12:55 +02:00

22 lines
559 B
TypeScript

// Metro module 11206 (f11207).
import { useMemo } from "react";
import GuildStore from "../../../stores/GuildStore";
export function getCommandContext(a0) {
return a0.type === "contextless" ? {
channel: void 0,
guild: void 0
} : {
channel: a0.channel,
guild: GuildStore.getGuild(a0.channel.guild_id)
};
}
export function useCommandContext(a0) {
return useMemo(() => a0.type === "contextless" ? {
channel: void 0,
guild: void 0
} : {
channel: a0.channel,
guild: GuildStore.getGuild(a0.channel.guild_id)
}, [a0]);
}