From 5a5d554789b031d5f3e0aa882e34023cb49d4b09 Mon Sep 17 00:00:00 2001 From: Aditya Banerjee Date: Sun, 4 Feb 2024 21:22:58 +0800 Subject: [PATCH] add webhook --- telegram-bot/src/components/bot.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telegram-bot/src/components/bot.ts b/telegram-bot/src/components/bot.ts index 8ee50ce..28ce585 100644 --- a/telegram-bot/src/components/bot.ts +++ b/telegram-bot/src/components/bot.ts @@ -8,6 +8,7 @@ import { commands } from 'constants/command'; const { TELEGRAM_BOT_TOKEN: token = '', + TELEGRAM_BOT_WEBHOOK_URL: webhook_url = '', NODE_ENV: env = 'DEV', PLATFORM: message_type = 'telegram', } = process.env; @@ -34,6 +35,7 @@ export class Bot { initialize(): void { this.logger.info('Initialising bot'); this.client.setMyCommands(commands); + if (env !== 'DEV') this.client.setWebHook(webhook_url); this.client.onText(/\/(start|help)/, (message: Message) => { this.help(message); });