Skip to content

Commit

Permalink
Enable handlerTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
wojpawlik authored and C0rn3j committed Feb 5, 2021
1 parent 62b3ab1 commit 3fe99f8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bot/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
'use strict';

const Telegraf = require('telegraf');
const ms = require('millisecond');
const { Telegraf } = require('telegraf');
const { config } = require('../utils/config');

/** @typedef { import('../typings/context').ExtendedContext } ExtendedContext */

/** @type { import('telegraf/typings').Telegraf<ExtendedContext> } */
const bot = new Telegraf(config.token);
/** @type { Telegraf<ExtendedContext> } */
const bot = new Telegraf(config.token, {
handlerTimeout: ms('5s'),
telegram: { webhookReply: false },
});

if (process.env.NODE_ENV === 'development') {
bot.polling.offset = -1;
Expand Down

0 comments on commit 3fe99f8

Please sign in to comment.