mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-02 23:25:20 +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 { managesGroup } = require('../../stores/group');
|
||||||
|
|
||||||
|
const { chats = {} } = require('../../config');
|
||||||
|
|
||||||
const pkg = require('../../package.json');
|
const pkg = require('../../package.json');
|
||||||
|
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ const randomChoice = arr => arr[Math.floor(Math.random() * arr.length)];
|
|||||||
const leaveUnmanagedHandler = async (ctx, next) => {
|
const leaveUnmanagedHandler = async (ctx, next) => {
|
||||||
if (
|
if (
|
||||||
ctx.chat.type === 'private' ||
|
ctx.chat.type === 'private' ||
|
||||||
|
Object.values(chats).includes(ctx.chat.id) ||
|
||||||
await managesGroup({ id: ctx.chat.id })) {
|
await managesGroup({ id: ctx.chat.id })) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user