Skip to content

Commit

Permalink
Change alerts url to env var
Browse files Browse the repository at this point in the history
  • Loading branch information
AJaccP committed Jul 28, 2024
1 parent 7347e24 commit e471a65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ npm install -g dotenv-cli
```
DISCORD_CHANNEL_WEBHOOK_URL=YOUR_WEBHOOK_URL_HERE
GITHUB_ACCESS_TOKEN=(ask Matthew for this)
DISCORD_ALERTS_WEBHOOK_URL=YOUR_ALERTS_CHANNEL_WEBHOOK_URL_HERE
```

7. Start the job:
Expand Down
4 changes: 2 additions & 2 deletions src/discord/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const sendDiscordItemMessage = async (
});
return Ok(response.data);
} catch (error) {
const alertWebhook =
"https://discord.com/api/webhooks/1255153467937390703/5v_7sPhvtFT3mtNPgogL1jcl56z6n2KHyjT1rCNf6wZ4vPFCAvrtr65fFVY562m48Znn";
const alertWebhook = process.env.DISCORD_ALERTS_WEBHOOK_URL ?? "";

await axios.post(alertWebhook, {
// @ts-ignore
content: `Failed to send Discord message: ${error.message}`,
Expand Down

0 comments on commit e471a65

Please sign in to comment.