diff --git a/src/modules/pipeLog.ts b/src/modules/pipeLog.ts index cc73dfd..fecd8ce 100644 --- a/src/modules/pipeLog.ts +++ b/src/modules/pipeLog.ts @@ -41,7 +41,8 @@ const pipeLog = async( }; /** - * Pipes a log message to the Gotify server. + * Pipes a log message to the Gotify server. Also notifies + * Naomi in Discord. * @param appName - The name of the application. * @param message - The message to log. * @param level - The level of the log, used for priority. @@ -67,6 +68,18 @@ const pipeError = async( }, method: "POST", }); + await fetch(`https://discord.com/api/v10/channels/1385797320389431336/messages`, { + body: JSON.stringify({ + content: `:warning: **${appName}** has encountered an error. <@465650873650118659> please check the logs.`, + }), + headers: { + // eslint-disable-next-line @typescript-eslint/naming-convention -- Standard header. + "Authorization": `Bot ${process.env.DISCORD_TOKEN ?? ""}`, + // eslint-disable-next-line @typescript-eslint/naming-convention -- Standard header. + "Content-Type": "application/json", + }, + method: "POST", + }); }; export { pipeError, pipeLog };