import { discordFetch } from "https://esm.town/v/vtdocs/discordFetch";
export const discordSendDM = async (
botToken: string,
recipientId: string,
content: string,
): Promise<string | undefined> => {
const DM = await discordFetch(
botToken,
"/users/@me/channels",
"POST",
JSON.stringify({
recipient_id: recipientId,
}),
);
await discordFetch(
botToken,
`/channels/${DM.id}/messages`,
"POST",
JSON.stringify({
content,
}),
);
return DM.id;
};