generated from nhcarrigan/template
27 lines
665 B
TypeScript
27 lines
665 B
TypeScript
/**
|
|
* @copyright nhcarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
|
|
import { WebhookClient, type MessageCreateOptions } from "discord.js";
|
|
|
|
const hook = new WebhookClient({
|
|
url: process.env.DISCORD_DEBUG_WEBHOOK ?? "",
|
|
});
|
|
|
|
/**
|
|
* Quick wrapper to send a debug message to the webhook.
|
|
* Modularised for future expansion if needed.
|
|
* @param message -- The message payload, compatible with Discord's API.
|
|
*/
|
|
export const sendDebugLog = async(
|
|
message: MessageCreateOptions,
|
|
): Promise<void> => {
|
|
await hook.send({
|
|
...message,
|
|
avatarURL: "https://cdn.nhcarrigan.com/art/logs.png",
|
|
username: "Moderation Logs",
|
|
});
|
|
};
|