From 3fe99f87bb39b350ee232cceb5091cdf415873f0 Mon Sep 17 00:00:00 2001 From: Wojciech Pawlik Date: Sun, 6 Sep 2020 14:14:24 +0200 Subject: [PATCH] Enable `handlerTimeout` Hopfully works around https://github.com/telegraf/telegraf/issues/735 #118 --- bot/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bot/index.js b/bot/index.js index 22fea6e3..4ef4d92d 100644 --- a/bot/index.js +++ b/bot/index.js @@ -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 } */ -const bot = new Telegraf(config.token); +/** @type { Telegraf } */ +const bot = new Telegraf(config.token, { + handlerTimeout: ms('5s'), + telegram: { webhookReply: false }, +}); if (process.env.NODE_ENV === 'development') { bot.polling.offset = -1;