2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +00:00

Bot manages group only if added there by master

It leaves with a message otherwise.
This commit is contained in:
GingerPlusPlus
2017-09-22 17:12:58 +02:00
parent 8c9457cd8c
commit ea97b2fb31
3 changed files with 63 additions and 0 deletions

View File

@@ -23,7 +23,11 @@ const banHandler = require('./handlers/ban');
const unbanHandler = require('./handlers/unban');
const messageHandler = require('./handlers/message');
const newChatMemberHandler = require('./handlers/newChatMember');
const addedToGroup = require('./handlers/addedToGroup');
const leaveUnmanaged = require('./handlers/leaveUnmanaged');
bot.on('new_chat_members', addedToGroup);
bot.use(leaveUnmanaged);
bot.use(middlewareHandler);
bot.command('admin', adminHandler);
bot.command('unadmin', unAdminHandler);