2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-23 02:17:47 +00:00
the-guard-bot/index.js
GingerPlusPlus 5bbdb529f1 Misc
2019-03-18 19:05:16 +01:00

32 lines
544 B
JavaScript

'use strict';
process.chdir(__dirname);
// 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);