This repository has been archived on 2025-05-22. You can view files and clone it, but cannot push or open issues or pull requests.
mod-logs/src/utils/sendDebugLog.ts

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",
});
};