generated from nhcarrigan/template
feat: use bot account #5
1
prod.env
1
prod.env
@ -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"
|
@ -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: [
|
||||
{
|
||||
@ -42,7 +42,9 @@ export const sendDiscord = async(
|
||||
}),
|
||||
headers: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Needs to match Discord's structure.
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Bot ${process.env.DISCORD_TOKEN ?? ""}`,
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Needs to match Discord's structure.
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: "POST",
|
||||
});
|
||||
|
Reference in New Issue
Block a user