2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-24 10:58:19 +00:00
the-guard-bot/index.js
2018-09-01 15:46:42 +02:00

30 lines
517 B
JavaScript

'use strict';
// Utils
const { logError } = require('./utils/log');
/**
* @type {Telegraf}
* Bot
*/
const bot = require('./bot');
bot.telegram.getMe().then((botInfo) => {
bot.options.username = botInfo.username;
bot.context.botInfo = botInfo;
}).then(() => {
bot.startPolling();
});
bot.use(
require('./handlers/middlewares'),
require('./handlers/messages'),
require('./plugins'),
require('./handlers/commands'),
require('./handlers/regex'),
require('./handlers/unmatched'),
);
bot.catch(logError);