2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 14:15:25 +00:00

refactored middleware into their own handlers

This commit is contained in:
Pouria Ezzati
2017-10-03 11:10:39 +03:30
parent 1b12efce72
commit 5fe5bd4561
4 changed files with 35 additions and 20 deletions

View File

@@ -13,7 +13,8 @@ bot.telegram.getMe().then((botInfo) => {
// Middleware Handlers
const leaveUnmanagedHandler = require('./handlers/middlewares/leaveUnmanaged');
const middlewareHandler = require('./handlers/middlewares/middleware');
const removeCommandsHandler = require('./handlers/middlewares/removeCommands');
const kickBannedHandler = require('./handlers/middlewares/kickBanned');
const addUserHandler = require('./handlers/middlewares/addUser');
const removeLinksHandler = require('./handlers/middlewares/removeLinks');
const checkUsernameHandler = require('./handlers/middlewares/checkUsername');
@@ -39,7 +40,8 @@ const helpHandler = require('./handlers/commands/help');
bot.on('new_chat_members', addedToGroupHandler);
bot.use(leaveUnmanagedHandler);
bot.use(middlewareHandler);
bot.use(removeCommandsHandler);
bot.use(kickBannedHandler);
bot.on('message', addUserHandler);
bot.on('message', removeLinksHandler);
bot.on('message', checkUsernameHandler);