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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user