Skip to content

Commit

Permalink
fix(telegram-notifier): handle kill signal
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Nov 25, 2022
1 parent 4c13aef commit a8e00a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions telegram-notifier/src/lib/bot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import {Telegraf} from 'telegraf';

import {config} from './config.js';
import {config, logger} from './config.js';

export const bot = new Telegraf(config.telegramBot.token);

bot.launch();
await bot.launch();

logger.logProperty('getMe', await bot.telegram.getMe());

process.once('SIGINT', () => bot.stop('SIGINT'));
process.once('SIGTERM', () => bot.stop('SIGTERM'));

0 comments on commit a8e00a7

Please sign in to comment.