feat: use bot account
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 28s

This commit is contained in:
2025-07-06 16:02:28 -07:00
parent c5bd74de4a
commit c21c426a9d
3 changed files with 6 additions and 3 deletions

View File

@ -5,3 +5,4 @@ EMAIL_PASSWORD="op://Environment Variables - Naomi/Alert Server/email_pass"
DISCORD_WEBHOOK_URL="op://Environment Variables - Naomi/Alert Server/discord_hook"
STRIPE_SECRET_KEY="op://Environment Variables - Naomi/Alert Server/stripe"
STRIPE_WEBHOOK_SECRET="op://Environment Variables - Naomi/Alert Server/stripe_webhook"
DISCORD_TOKEN="op://Environment Variables - Naomi/Alert Server/discord_token"

View File

@ -13,7 +13,7 @@ export const sendDiscord = async(
subject: string,
body: string,
): Promise<void> => {
await fetch(`${process.env.DISCORD_WEBHOOK_URL ?? ""}?with_components=true`, {
await fetch(`https://discord.com/api/v10/channels/1355232348840394785/messages`, {
body: JSON.stringify({
components: [
{
@ -41,6 +41,8 @@ export const sendDiscord = async(
flags: 32_768,
}),
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention -- Needs to match Discord's structure.
"Authorization": `Bot ${process.env.DISCORD_TOKEN ?? ""}`,
// eslint-disable-next-line @typescript-eslint/naming-convention -- Needs to match Discord's structure.
"Content-Type": "application/json",
},

View File