Skip to content

Commit

Permalink
Add webhook logging (#266)
Browse files Browse the repository at this point in the history
### Notes

Adds logging to the webhook to confirm router has started / webhook URL
has been set correctly.
  • Loading branch information
Shadowfiend authored Jun 15, 2023
2 parents 6d76452 + 69176db commit 72a3562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion discord-scripts/discord-webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default async function webhookDiscord(
if (process.env.HUBOT_WEBHOOK_URL) {
const webhookUrl = process.env.HUBOT_WEBHOOK_URL
const requiredAuth = process.env.HUBOT_WEBHOOK_AUTH

robot.logger.info("Webhook URL has been set: ", webhookUrl)
robot.logger.info("Webhook Auth has been set: ", requiredAuth)
robot.router.post(
`${webhookUrl}`,
(
Expand All @@ -83,5 +84,6 @@ export default async function webhookDiscord(
res.status(200).send("Message sent to Discord")
},
)
robot.logger.info("Webhook is now enabled")
}
}

0 comments on commit 72a3562

Please sign in to comment.