1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-23 15:19:44 +02:00

Added functionality to send notifications to a specific topic

Co-authored-by: Elllone <elllone@diklosgroup.ru>
on-behalf-of: @DiklosGroup <contact@diklosgroup.ru>
This commit is contained in:
Elllone 2024-10-30 16:17:44 +03:00
parent 4fa62325a2
commit 9cb38c6e30
No known key found for this signature in database
GPG key ID: 65F0FF579B8D0D2D
5 changed files with 9 additions and 0 deletions

View file

@ -70,6 +70,7 @@ services:
# - TELEGRAM_BOT_TOKEN=
# - TELEGRAM_CHAT_ID=
# - TELEGRAM_THREAD_ID=
working_dir: /app
command: ['sh', '-c', 'npm run start']
depends_on:

View file

@ -78,6 +78,7 @@ services:
# - TELEGRAM_BOT_TOKEN=
# - TELEGRAM_CHAT_ID=
# - TELEGRAM_THREAD_ID=
depends_on:
postgres:
condition: service_healthy

View file

@ -69,6 +69,7 @@ SECRET_KEY=notsecretkey
# TELEGRAM_BOT_TOKEN=
# TELEGRAM_CHAT_ID=
# TELEGRAM_THREAD_ID=
## Do not edit this

View file

@ -18,6 +18,11 @@ module.exports = {
text: inputs.html,
parse_mode: 'HTML',
};
if (sails.config.custom.telegramThreadId) {
body.message_thread_id = sails.config.custom.telegramThreadId;
}
let response;
try {
response = await fetch(POST_MESSAGE_API_URL(sails.config.custom.telegramBotToken), {

View file

@ -86,4 +86,5 @@ module.exports.custom = {
telegramBotToken: process.env.TELEGRAM_BOT_TOKEN,
telegramChatId: process.env.TELEGRAM_CHAT_ID,
telegramThreadId: process.env.TELEGRAM_THREAD_ID,
};