2017-09-21 13:57:49 +04:30
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const Telegraf = require('telegraf');
|
2020-03-09 23:27:19 +01:00
|
|
|
const { config } = require('../utils/config');
|
2017-09-21 13:57:49 +04:30
|
|
|
|
2020-03-10 22:10:48 +01:00
|
|
|
/** @typedef { import('../typings/context').ExtendedContext } ExtendedContext */
|
|
|
|
|
|
|
|
/** @type { import('telegraf/typings').Telegraf<ExtendedContext> } */
|
2017-09-21 13:57:49 +04:30
|
|
|
const bot = new Telegraf(config.token);
|
|
|
|
|
2020-06-06 10:51:46 +02:00
|
|
|
bot.polling.offset = -1;
|
2017-11-01 20:59:27 +01:00
|
|
|
|
2017-09-21 13:57:49 +04:30
|
|
|
module.exports = bot;
|
2018-05-05 20:10:22 +02:00
|
|
|
|
|
|
|
// cyclic dependency
|
|
|
|
// bot/index requires context requires actions/warn requires bot/index
|
|
|
|
Object.assign(bot.context, require('./context'));
|