22 lines
559 B
TypeScript
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]);
|
|
}
|