mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-01 22:55:24 +00:00
Enable handlerTimeout
Hopfully works around https://github.com/telegraf/telegraf/issues/735 #118
This commit is contained in:
10
bot/index.js
10
bot/index.js
@@ -1,12 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const Telegraf = require('telegraf');
|
const ms = require('millisecond');
|
||||||
|
const { Telegraf } = require('telegraf');
|
||||||
const { config } = require('../utils/config');
|
const { config } = require('../utils/config');
|
||||||
|
|
||||||
/** @typedef { import('../typings/context').ExtendedContext } ExtendedContext */
|
/** @typedef { import('../typings/context').ExtendedContext } ExtendedContext */
|
||||||
|
|
||||||
/** @type { import('telegraf/typings').Telegraf<ExtendedContext> } */
|
/** @type { Telegraf<ExtendedContext> } */
|
||||||
const bot = new Telegraf(config.token);
|
const bot = new Telegraf(config.token, {
|
||||||
|
handlerTimeout: ms('5s'),
|
||||||
|
telegram: { webhookReply: false },
|
||||||
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
bot.polling.offset = -1;
|
bot.polling.offset = -1;
|
||||||
|
Reference in New Issue
Block a user