generated from nhcarrigan/template
feat: use bot account (#5)
### Explanation _No response_ ### Issue _No response_ ### Attestations - [ ] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [ ] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [ ] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [ ] I have pinned the dependencies to a specific patch version. ### Style - [ ] I have run the linter and resolved any errors. - [ ] My pull request uses an appropriate title, matching the conventional commit standards. - [ ] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [ ] My contribution adds new code, and I have added tests to cover it. - [ ] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [ ] All new and existing tests pass locally with my changes. - [ ] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning _No response_ Reviewed-on: #5 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
3
prod.env
3
prod.env
@ -4,4 +4,5 @@ API_AUTH="op://Environment Variables - Naomi/Alert Server/api_auth"
|
||||
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"
|
||||
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