feat: initial commit
This commit is contained in:
commit
ff4d66c3d3
6 changed files with 530 additions and 0 deletions
43
app.js
Normal file
43
app.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
'use strict'
|
||||
|
||||
const axios = require('axios');
|
||||
const sentry = require("@sentry/node");
|
||||
|
||||
sentry.init({
|
||||
dsn: process.env.SENTRY_DSN
|
||||
})
|
||||
|
||||
const WEBHOOK_URL = process.env.WEBHOOK_URL || ''
|
||||
|
||||
if (WEBHOOK_URL === '') {
|
||||
console.error('[ERROR] WEBHOOK_URL environment variable is not set and is required.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const config = {
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-type': 'application/json',
|
||||
}
|
||||
}
|
||||
|
||||
const message = {
|
||||
"content": "**Čas na další standup!**\nAhoj všichni, je pondělí a je tedy čas na další standup!\n\ncc @here",
|
||||
"embeds": [
|
||||
{
|
||||
"title": "HELP: WTF is Standup?",
|
||||
"description": "Krátké sepsání na čem pracujete, třeba v bodech. Co máte hotové z aktuálního sprintu, na čem pracujete, co vás ještě čeká, případné překážky nebo zda s něčím potřebujete pomoc.",
|
||||
"color": 5814783,
|
||||
"timestamp": (new Date()).toISOString() // "2022-05-24T22:00:00.000Z"
|
||||
}
|
||||
],
|
||||
"attachments": []
|
||||
}
|
||||
|
||||
try {
|
||||
axios.post(WEBHOOK_URL, message, config)
|
||||
} catch (e) {
|
||||
sentry.captureException(e)
|
||||
console.error(`[ERROR] ${e}`)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in a new issue