From 1f4a291dbf7cdf89512a8187c978269e34d77b54 Mon Sep 17 00:00:00 2001 From: AstroX11 Date: Wed, 15 Jan 2025 17:58:31 +0100 Subject: [PATCH 1/2] fix: added more cmd excution checks This fix adjusts the command execution for the WORK_TYPE defined from config.js, if the work type is on private and the sender isn't a Sudo User, the bot won't execute the command --- lib/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index df144c2..859ff6c 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -153,7 +153,7 @@ const logMessage = async (msg, conn) => { const executeCommand = (msg, conn, m) => { plugins.commands.forEach(async (command) => { - if (command.fromMe && !msg.sudo) return; + if (command.fromMe && !msg.sudo || config.WORK_TYPE === 'private' && !msg.sudo) return; const handleCommand = (Instance, args) => { const whats = new Instance(conn, msg); From e4fb977e8901c05498ed352861e96bd2d09b9cd6 Mon Sep 17 00:00:00 2001 From: AstroX11 Date: Wed, 15 Jan 2025 18:03:37 +0100 Subject: [PATCH 2/2] fix: adjusted based on code recommendation --- lib/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index 859ff6c..055d5cf 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -153,7 +153,7 @@ const logMessage = async (msg, conn) => { const executeCommand = (msg, conn, m) => { plugins.commands.forEach(async (command) => { - if (command.fromMe && !msg.sudo || config.WORK_TYPE === 'private' && !msg.sudo) return; + if (!msg.sudo && (command.fromMe || config.WORK_TYPE === 'private')) return const handleCommand = (Instance, args) => { const whats = new Instance(conn, msg);