Skip to content

Commit

Permalink
add webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
adidoesnt committed Feb 4, 2024
1 parent 2260e8e commit 5a5d554
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions telegram-bot/src/components/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
});
Expand Down

0 comments on commit 5a5d554

Please sign in to comment.