2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 14:15:25 +00:00

Enable handlerTimeout

Hopfully works around https://github.com/telegraf/telegraf/issues/735
#118
This commit is contained in:
Wojciech Pawlik
2020-09-06 14:14:24 +02:00
parent eab18c3e85
commit abffcb6790

View File

@@ -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;