2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-30 21:55:17 +00:00

Never leave chats listed in config

This commit is contained in:
GingerPlusPlus
2019-01-24 16:02:20 +01:00
parent 92ec6e9725
commit 1f43ed4119

View File

@@ -5,6 +5,8 @@ const { logError } = require('../../utils/log');
const { managesGroup } = require('../../stores/group');
const { chats = {} } = require('../../config');
const pkg = require('../../package.json');
@@ -49,6 +51,7 @@ const randomChoice = arr => arr[Math.floor(Math.random() * arr.length)];
const leaveUnmanagedHandler = async (ctx, next) => {
if (
ctx.chat.type === 'private' ||
Object.values(chats).includes(ctx.chat.id) ||
await managesGroup({ id: ctx.chat.id })) {
return next();
}