2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-22 18:08:51 +00:00
the-guard-bot/index.js

30 lines
517 B
JavaScript
Raw Normal View History

2017-07-24 17:12:38 +02:00
'use strict';
// Utils
const { logError } = require('./utils/log');
2017-09-21 13:57:49 +04:30
/**
* @type {Telegraf}
* Bot
*/
2017-09-21 13:57:49 +04:30
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'),
2017-10-27 18:43:33 +02:00
require('./plugins'),
require('./handlers/commands'),
require('./handlers/regex'),
require('./handlers/unmatched'),
);
2017-07-24 18:08:31 +02:00
bot.catch(logError);