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:
parent
4fa62325a2
commit
9cb38c6e30
5 changed files with 9 additions and 0 deletions
|
@ -70,6 +70,7 @@ services:
|
||||||
|
|
||||||
# - TELEGRAM_BOT_TOKEN=
|
# - TELEGRAM_BOT_TOKEN=
|
||||||
# - TELEGRAM_CHAT_ID=
|
# - TELEGRAM_CHAT_ID=
|
||||||
|
# - TELEGRAM_THREAD_ID=
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: ['sh', '-c', 'npm run start']
|
command: ['sh', '-c', 'npm run start']
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
@ -78,6 +78,7 @@ services:
|
||||||
|
|
||||||
# - TELEGRAM_BOT_TOKEN=
|
# - TELEGRAM_BOT_TOKEN=
|
||||||
# - TELEGRAM_CHAT_ID=
|
# - TELEGRAM_CHAT_ID=
|
||||||
|
# - TELEGRAM_THREAD_ID=
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
|
@ -69,6 +69,7 @@ SECRET_KEY=notsecretkey
|
||||||
|
|
||||||
# TELEGRAM_BOT_TOKEN=
|
# TELEGRAM_BOT_TOKEN=
|
||||||
# TELEGRAM_CHAT_ID=
|
# TELEGRAM_CHAT_ID=
|
||||||
|
# TELEGRAM_THREAD_ID=
|
||||||
|
|
||||||
|
|
||||||
## Do not edit this
|
## Do not edit this
|
||||||
|
|
|
@ -18,6 +18,11 @@ module.exports = {
|
||||||
text: inputs.html,
|
text: inputs.html,
|
||||||
parse_mode: 'HTML',
|
parse_mode: 'HTML',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (sails.config.custom.telegramThreadId) {
|
||||||
|
body.message_thread_id = sails.config.custom.telegramThreadId;
|
||||||
|
}
|
||||||
|
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
response = await fetch(POST_MESSAGE_API_URL(sails.config.custom.telegramBotToken), {
|
response = await fetch(POST_MESSAGE_API_URL(sails.config.custom.telegramBotToken), {
|
||||||
|
|
|
@ -86,4 +86,5 @@ module.exports.custom = {
|
||||||
|
|
||||||
telegramBotToken: process.env.TELEGRAM_BOT_TOKEN,
|
telegramBotToken: process.env.TELEGRAM_BOT_TOKEN,
|
||||||
telegramChatId: process.env.TELEGRAM_CHAT_ID,
|
telegramChatId: process.env.TELEGRAM_CHAT_ID,
|
||||||
|
telegramThreadId: process.env.TELEGRAM_THREAD_ID,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue