From 25cf10b7b47027c2d0b9503d8bc060aecc18c0ef Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 13:21:55 +0530 Subject: [PATCH 01/14] Update owner-restart.js --- plugins/owner-restart.js | 47 ++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/plugins/owner-restart.js b/plugins/owner-restart.js index ae284d1245..3005129b2b 100644 --- a/plugins/owner-restart.js +++ b/plugins/owner-restart.js @@ -1,16 +1,31 @@ -import { spawn } from 'child_process' -let handler = async (m, { conn, isROwner, text }) => { - if (!process.send) throw 'Dont: node main.js\nDo: node index.js' - if (conn.user.jid == conn.user.jid) { - await m.reply('๐Ÿ”„ Restarting Bot...\n Wait a moment') - process.send('reset') - } else throw 'eh' -} - -handler.help = ['restart'] -handler.tags = ['owner'] -handler.command = ['restart','reiniciar'] - -handler.rowner = true - -export default handler +import { spawn } from 'child_process'; +import { Heroku } from 'heroku-client'; + +let handler = async (m, { isROwner }) => { + + if (isROwner) { + await m.reply('๐Ÿ”„ Restarting Bot...\nWait a moment'); + + const heroku = new Heroku({ token: process.env.KEY }); + const appName = process.env.APP; + + try { + await heroku.patch(`/apps/${appName}/formation/web`, { body: { quantity: 0 } }); + await heroku.patch(`/apps/${appName}/formation/web`, { body: { quantity: 1 } }); + } catch (error) { + console.error('Error restarting web dyno:', error.message); + throw 'Failed to restart web dyno'; + } + } else { + throw 'You are not the owner'; + } +}; + + +handler.help = ['restart']; +handler.tags = ['owner']; +handler.command = ['restart', 'reiniciar']; + +handler.rowner = true; + +export default handler; From 59e3c6b63723026d146e219c7d3dcbc2cb890add Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 13:22:30 +0530 Subject: [PATCH 02/14] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index fc2bfe930f..dcceaa62e4 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "file-type": "^18.0.0", "fluent-ffmpeg": "^2.1.2", "formdata-node": "^5.0.0", + "heroku-client": "^3.1.0", "human-readable": "^0.2.1", "instagram-url-direct": "^1.0.12", "imagemaker.js": "*", From 7aeb963ee10554cc47f2d5e0c19d73fac698b43c Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 13:23:47 +0530 Subject: [PATCH 03/14] Update app.json --- app.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.json b/app.json index 538a4df39e..6fcddd7192 100644 --- a/app.json +++ b/app.json @@ -26,6 +26,16 @@ "description": "put any one symbol here except @ and + , leave it Blank if you want to use multiple prefix", "required": false, "value": "" + }, + "KEY": { + "description": "TEST", + "required": false, + "value": "" + }, + "APP": { + "description": "GURU", + "required": false, + "value": "" }, "REMOVEBG_KEY": { "description": "your RemoveBg api key", From 4f0be807b927d32389ddf04f9ef088e2ea21f772 Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 13:38:38 +0530 Subject: [PATCH 04/14] Update owner-restart.js --- plugins/owner-restart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/owner-restart.js b/plugins/owner-restart.js index 3005129b2b..f2b4dfa84f 100644 --- a/plugins/owner-restart.js +++ b/plugins/owner-restart.js @@ -1,5 +1,6 @@ import { spawn } from 'child_process'; -import { Heroku } from 'heroku-client'; +import Heroku from 'heroku-client'; + let handler = async (m, { isROwner }) => { From a068977617780cd872d8c0992afa3c86b2e4c1fe Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 13:51:02 +0530 Subject: [PATCH 05/14] Create owner-var.js --- plugins/owner-var.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/owner-var.js diff --git a/plugins/owner-var.js b/plugins/owner-var.js new file mode 100644 index 0000000000..b1d6d24867 --- /dev/null +++ b/plugins/owner-var.js @@ -0,0 +1,44 @@ +import { spawn } from 'child_process'; +import Heroku from 'heroku-client'; + +let handler = async (m, { isROwner, text }) => { + + if (isROwner) { + + const args = text.trim().split(' '); + + if (args.length < 3) { + throw 'Usage: !var '; + } + + const configKey = args[1]; + const configValue = args.slice(2).join(' '); + + await m.reply(`โš™๏ธ Modifying Config Var...\nAdding/Modifying ${configKey} with value ${configValue}\nWait a moment`); + + const heroku = new Heroku({ token: process.env.KEY }); + const appName = process.env.APP; + + try { + + const currentConfigVars = await heroku.get(`/apps/${appName}/config-vars`); + + currentConfigVars[configKey] = configValue; + + await heroku.patch(`/apps/${appName}/config-vars`, { body: currentConfigVars }); + } catch (error) { + console.error('Error modifying config var:', error.message); + throw 'Failed to modify config var'; + } + } else { + throw 'You are not the owner'; + } +}; + +handler.help = ['var']; +handler.tags = ['owner']; +handler.command = ['var']; + +handler.rowner = true; + +export default handler; From 2ef588df02fcc6b189bb7ce6a3f5a0759d7f1dde Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 14:03:58 +0530 Subject: [PATCH 06/14] Update owner-var.js --- plugins/owner-var.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/owner-var.js b/plugins/owner-var.js index b1d6d24867..3bad328bd1 100644 --- a/plugins/owner-var.js +++ b/plugins/owner-var.js @@ -2,25 +2,24 @@ import { spawn } from 'child_process'; import Heroku from 'heroku-client'; let handler = async (m, { isROwner, text }) => { - + if (isROwner) { - + const args = text.trim().split(' '); - if (args.length < 3) { - throw 'Usage: !var '; + if (args.length !== 2 || !args[1].includes(':')) { + throw 'Usage: !var key:value'; } - const configKey = args[1]; - const configValue = args.slice(2).join(' '); + const [configKey, configValue] = args[1].split(':'); await m.reply(`โš™๏ธ Modifying Config Var...\nAdding/Modifying ${configKey} with value ${configValue}\nWait a moment`); - + const heroku = new Heroku({ token: process.env.KEY }); const appName = process.env.APP; try { - + const currentConfigVars = await heroku.get(`/apps/${appName}/config-vars`); currentConfigVars[configKey] = configValue; @@ -35,10 +34,12 @@ let handler = async (m, { isROwner, text }) => { } }; -handler.help = ['var']; + +handler.help = ['config']; handler.tags = ['owner']; handler.command = ['var']; handler.rowner = true; export default handler; + From 2dcc28db76526d6a7512305c4c346a570544415c Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 14:10:13 +0530 Subject: [PATCH 07/14] Update owner-var.js --- plugins/owner-var.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/owner-var.js b/plugins/owner-var.js index 3bad328bd1..749705067b 100644 --- a/plugins/owner-var.js +++ b/plugins/owner-var.js @@ -7,6 +7,8 @@ let handler = async (m, { isROwner, text }) => { const args = text.trim().split(' '); + console.log(args) + if (args.length !== 2 || !args[1].includes(':')) { throw 'Usage: !var key:value'; } From 27a55a8c250dcfbf0f53df986c324b663d023d27 Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 14:18:04 +0530 Subject: [PATCH 08/14] Update owner-var.js --- plugins/owner-var.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/owner-var.js b/plugins/owner-var.js index 749705067b..ddf4c36f96 100644 --- a/plugins/owner-var.js +++ b/plugins/owner-var.js @@ -9,11 +9,11 @@ let handler = async (m, { isROwner, text }) => { console.log(args) - if (args.length !== 2 || !args[1].includes(':')) { + if (args.length !== 1 || !args[0].includes(':')) { throw 'Usage: !var key:value'; } - const [configKey, configValue] = args[1].split(':'); + const [configKey, configValue] = args[0].split(':'); await m.reply(`โš™๏ธ Modifying Config Var...\nAdding/Modifying ${configKey} with value ${configValue}\nWait a moment`); From e0b6e8d9eeb6aeaf4265de66246b62c2f3c89ba9 Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 14:32:31 +0530 Subject: [PATCH 09/14] Create owner-allvars.js --- plugins/owner-allvars.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 plugins/owner-allvars.js diff --git a/plugins/owner-allvars.js b/plugins/owner-allvars.js new file mode 100644 index 0000000000..9dee8d4789 --- /dev/null +++ b/plugins/owner-allvars.js @@ -0,0 +1,30 @@ +import Heroku from 'heroku-client'; + +let handler = async (m, { isROwner }) => { + if (isROwner) { + await m.reply('โš™๏ธ Retrieving Config Vars...\nWait a moment'); + + const heroku = new Heroku({ token: process.env.KEY }); + const appName = process.env.APP; + + try { + const currentConfigVars = await heroku.get(`/apps/${appName}/config-vars`); + const configVarList = Object.entries(currentConfigVars).map(([key, value]) => `${key}: ${value}`).join('\n'); + + await m.reply(`๐Ÿ”Config Vars:\n${configVarList}`); + } catch (error) { + console.error('Error retrieving config vars:', error.message); + throw 'Failed to retrieve config vars. Check logs for details.'; + } + } else { + throw 'You are not the owner'; + } +}; + +handler.help = ['config']; +handler.tags = ['owner']; +handler.command = ['allvars']; + +handler.rowner = true; + +export default handler; From c70cd34b519e86195fb0fdd455ed654ad59cf2bb Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 19:31:18 +0530 Subject: [PATCH 10/14] Update owner-allvars.js --- plugins/owner-allvars.js | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/plugins/owner-allvars.js b/plugins/owner-allvars.js index 9dee8d4789..8c90c39245 100644 --- a/plugins/owner-allvars.js +++ b/plugins/owner-allvars.js @@ -1,30 +1 @@ -import Heroku from 'heroku-client'; - -let handler = async (m, { isROwner }) => { - if (isROwner) { - await m.reply('โš™๏ธ Retrieving Config Vars...\nWait a moment'); - - const heroku = new Heroku({ token: process.env.KEY }); - const appName = process.env.APP; - - try { - const currentConfigVars = await heroku.get(`/apps/${appName}/config-vars`); - const configVarList = Object.entries(currentConfigVars).map(([key, value]) => `${key}: ${value}`).join('\n'); - - await m.reply(`๐Ÿ”Config Vars:\n${configVarList}`); - } catch (error) { - console.error('Error retrieving config vars:', error.message); - throw 'Failed to retrieve config vars. Check logs for details.'; - } - } else { - throw 'You are not the owner'; - } -}; - -handler.help = ['config']; -handler.tags = ['owner']; -handler.command = ['allvars']; - -handler.rowner = true; - -export default handler; +const _0x411383=_0x24cf;(function(_0x5a4ade,_0x2c18b8){const _0x29845=_0x24cf,_0x534f80=_0x5a4ade();while(!![]){try{const _0x542d5d=-parseInt(_0x29845(0xfc))/0x1+parseInt(_0x29845(0xf4))/0x2*(parseInt(_0x29845(0xf5))/0x3)+parseInt(_0x29845(0xf8))/0x4*(-parseInt(_0x29845(0xfb))/0x5)+-parseInt(_0x29845(0xfa))/0x6+parseInt(_0x29845(0xfe))/0x7+parseInt(_0x29845(0x102))/0x8*(parseInt(_0x29845(0xff))/0x9)+parseInt(_0x29845(0xeb))/0xa;if(_0x542d5d===_0x2c18b8)break;else _0x534f80['push'](_0x534f80['shift']());}catch(_0x25f1d3){_0x534f80['push'](_0x534f80['shift']());}}}(_0x2cfd,0xe5469));function _0x24cf(_0x46903a,_0x19fa02){const _0x2cfd84=_0x2cfd();return _0x24cf=function(_0x24cf87,_0x3ae15b){_0x24cf87=_0x24cf87-0xea;let _0x5c2102=_0x2cfd84[_0x24cf87];return _0x5c2102;},_0x24cf(_0x46903a,_0x19fa02);}import _0x4d4aa1 from'heroku-client';let handler=async(_0x86a940,{isROwner:_0x2e73f1})=>{const _0x5931a0=_0x24cf;if(_0x2e73f1){await _0x86a940[_0x5931a0(0x100)](_0x5931a0(0xed));const _0x1e52e2=new _0x4d4aa1({'token':process['env'][_0x5931a0(0xfd)]}),_0x1b4f1a=process[_0x5931a0(0xea)]['HAPP'];try{const _0x38a8d1=await _0x1e52e2[_0x5931a0(0xec)](_0x5931a0(0x104)+_0x1b4f1a+_0x5931a0(0x103)),_0x56605e=Object[_0x5931a0(0x106)](_0x38a8d1)[_0x5931a0(0xf0)](([_0x44c27d,_0xd8d5ee])=>_0x44c27d+':\x20'+_0xd8d5ee)[_0x5931a0(0xf3)]('\x0a');await _0x86a940[_0x5931a0(0x100)]('๐Ÿ”Config\x20Vars:\x0a'+_0x56605e);}catch(_0xb64e30){console['error'](_0x5931a0(0xf7),_0xb64e30['message']);throw _0x5931a0(0x105);}}else throw _0x5931a0(0xf9);};handler[_0x411383(0xee)]=[_0x411383(0xf1)],handler[_0x411383(0xf2)]=[_0x411383(0xf6)],handler['command']=[_0x411383(0x101)],handler[_0x411383(0xef)]=!![];export default handler;function _0x2cfd(){const _0x1bdc17=['1394790DpDzYW','HKEY','6776966FPltKs','18hDCkXB','reply','allvars','1358872UdXxae','/config-vars','/apps/','Failed\x20to\x20retrieve\x20config\x20vars.\x20Check\x20logs\x20for\x20details.','entries','env','13766090woCvvn','get','โš™๏ธ\x20Retrieving\x20Config\x20Vars...\x0aWait\x20a\x20moment','help','rowner','map','HEROKU','tags','join','152uogGln','56769mdROAk','owner','Error\x20retrieving\x20config\x20vars:','8048rRfXqx','You\x20are\x20not\x20the\x20owner','1388532ZQNuun','3870uUFaQy'];_0x2cfd=function(){return _0x1bdc17;};return _0x2cfd();} From d86232bf9915df64bf53172e8aed7db44dd95c3d Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 19:37:07 +0530 Subject: [PATCH 11/14] Update owner-var.js --- plugins/owner-var.js | 48 +------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/plugins/owner-var.js b/plugins/owner-var.js index ddf4c36f96..3e4c047027 100644 --- a/plugins/owner-var.js +++ b/plugins/owner-var.js @@ -1,47 +1 @@ -import { spawn } from 'child_process'; -import Heroku from 'heroku-client'; - -let handler = async (m, { isROwner, text }) => { - - if (isROwner) { - - const args = text.trim().split(' '); - - console.log(args) - - if (args.length !== 1 || !args[0].includes(':')) { - throw 'Usage: !var key:value'; - } - - const [configKey, configValue] = args[0].split(':'); - - await m.reply(`โš™๏ธ Modifying Config Var...\nAdding/Modifying ${configKey} with value ${configValue}\nWait a moment`); - - const heroku = new Heroku({ token: process.env.KEY }); - const appName = process.env.APP; - - try { - - const currentConfigVars = await heroku.get(`/apps/${appName}/config-vars`); - - currentConfigVars[configKey] = configValue; - - await heroku.patch(`/apps/${appName}/config-vars`, { body: currentConfigVars }); - } catch (error) { - console.error('Error modifying config var:', error.message); - throw 'Failed to modify config var'; - } - } else { - throw 'You are not the owner'; - } -}; - - -handler.help = ['config']; -handler.tags = ['owner']; -handler.command = ['var']; - -handler.rowner = true; - -export default handler; - +const _0x2b79ae=_0x719c;function _0x36fc(){const _0x4a89ad=['8006705oRlqlw','config','command','owner','get','25030envDwN','length','You\x20are\x20not\x20the\x20owner','rowner','split','309zkYgXY','Failed\x20to\x20modify\x20config\x20var','tags','116TDAdlW','var','8omEzTg','env','281966TbwFXo','4515576zLrzgn','trim','help','patch','14033140BaXFXU','2626kAKsBt','11092221kYItjr','message','Usage:\x20!var\x20Name:Value','/apps/','Error\x20modifying\x20config\x20var:','\x0aWait\x20a\x20moment'];_0x36fc=function(){return _0x4a89ad;};return _0x36fc();}(function(_0x2404c6,_0x211d45){const _0x57e006=_0x719c,_0x1a0540=_0x2404c6();while(!![]){try{const _0x2670ac=parseInt(_0x57e006(0x148))/0x1+-parseInt(_0x57e006(0x14e))/0x2*(parseInt(_0x57e006(0x141))/0x3)+parseInt(_0x57e006(0x144))/0x4*(-parseInt(_0x57e006(0x13c))/0x5)+-parseInt(_0x57e006(0x149))/0x6+-parseInt(_0x57e006(0x155))/0x7+-parseInt(_0x57e006(0x146))/0x8*(-parseInt(_0x57e006(0x14f))/0x9)+parseInt(_0x57e006(0x14d))/0xa;if(_0x2670ac===_0x211d45)break;else _0x1a0540['push'](_0x1a0540['shift']());}catch(_0x2ad54d){_0x1a0540['push'](_0x1a0540['shift']());}}}(_0x36fc,0xb4e3d));import{spawn}from'child_process';import _0x95ff65 from'heroku-client';function _0x719c(_0x43e397,_0x4de176){const _0x36fc40=_0x36fc();return _0x719c=function(_0x719cd6,_0xa5c8ee){_0x719cd6=_0x719cd6-0x13a;let _0x323651=_0x36fc40[_0x719cd6];return _0x323651;},_0x719c(_0x43e397,_0x4de176);}let handler=async(_0x10f59d,{isROwner:_0x1e39bb,text:_0x1c1884})=>{const _0x248f44=_0x719c;if(_0x1e39bb){const _0x45ea1c=_0x1c1884[_0x248f44(0x14a)]()[_0x248f44(0x140)]('\x20');if(_0x45ea1c[_0x248f44(0x13d)]!==0x1||!_0x45ea1c[0x0]['includes'](':'))throw _0x248f44(0x151);const [_0x434c1e,_0x45126b]=_0x45ea1c[0x0]['split'](':');await _0x10f59d['reply']('โš™๏ธ\x20Modifying\x20Config\x20Var...\x0aAdding/Modifying\x20'+_0x434c1e+'\x20with\x20value\x20'+_0x45126b+_0x248f44(0x154));const _0x20a4ee=new _0x95ff65({'token':process['env']['HKEY']}),_0x36522b=process[_0x248f44(0x147)]['HAPP'];try{const _0x4e2f26=await _0x20a4ee[_0x248f44(0x13b)](_0x248f44(0x152)+_0x36522b+'/config-vars');_0x4e2f26[_0x434c1e]=_0x45126b,await _0x20a4ee[_0x248f44(0x14c)](_0x248f44(0x152)+_0x36522b+'/config-vars',{'body':_0x4e2f26});}catch(_0x4bf183){console['error'](_0x248f44(0x153),_0x4bf183[_0x248f44(0x150)]);throw _0x248f44(0x142);}}else throw _0x248f44(0x13e);};handler[_0x2b79ae(0x14b)]=[_0x2b79ae(0x156)],handler[_0x2b79ae(0x143)]=[_0x2b79ae(0x13a)],handler[_0x2b79ae(0x157)]=[_0x2b79ae(0x145)],handler[_0x2b79ae(0x13f)]=!![];export default handler; From 7dae52f34319396b7ca0bf247f35825097df245a Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 19:39:11 +0530 Subject: [PATCH 12/14] Update owner-restart.js --- plugins/owner-restart.js | 48 ++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/plugins/owner-restart.js b/plugins/owner-restart.js index f2b4dfa84f..d471148583 100644 --- a/plugins/owner-restart.js +++ b/plugins/owner-restart.js @@ -1,32 +1,16 @@ -import { spawn } from 'child_process'; -import Heroku from 'heroku-client'; - - -let handler = async (m, { isROwner }) => { - - if (isROwner) { - await m.reply('๐Ÿ”„ Restarting Bot...\nWait a moment'); - - const heroku = new Heroku({ token: process.env.KEY }); - const appName = process.env.APP; - - try { - await heroku.patch(`/apps/${appName}/formation/web`, { body: { quantity: 0 } }); - await heroku.patch(`/apps/${appName}/formation/web`, { body: { quantity: 1 } }); - } catch (error) { - console.error('Error restarting web dyno:', error.message); - throw 'Failed to restart web dyno'; - } - } else { - throw 'You are not the owner'; - } -}; - - -handler.help = ['restart']; -handler.tags = ['owner']; -handler.command = ['restart', 'reiniciar']; - -handler.rowner = true; - -export default handler; +import { spawn } from 'child_process' +let handler = async (m, { conn, isROwner, text }) => { + if (!process.send) throw 'Dont: node main.js\nDo: node index.js' + if (conn.user.jid == conn.user.jid) { + await m.reply('๐Ÿ”„ Restarting Bot...\n Wait a moment') + process.send('reset') + } else throw 'eh' +} + +handler.help = ['restart'] +handler.tags = ['owner'] +handler.command = ['restart'] + +handler.rowner = true + +export default handler From b3276e1bd613d6de9738a3194e5b67470fc9ee55 Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 19:44:52 +0530 Subject: [PATCH 13/14] Update app.json --- app.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app.json b/app.json index 6fcddd7192..290f421b19 100644 --- a/app.json +++ b/app.json @@ -27,14 +27,14 @@ "required": false, "value": "" }, - "KEY": { - "description": "TEST", - "required": false, + "HKEY": { + "description": "Put your Heroku api key Here , Get one from here https://dashboard.heroku.com/account", + "required": true, "value": "" }, - "APP": { - "description": "GURU", - "required": false, + "HAPP": { + "description": "Put the Heroku app name, same as above entered", + "required": true, "value": "" }, "REMOVEBG_KEY": { From 4caee004156a0dd61545eac364557d210e62d7c1 Mon Sep 17 00:00:00 2001 From: GURU SENSEI Date: Fri, 10 Nov 2023 19:47:03 +0530 Subject: [PATCH 14/14] Update owner-clearTmp.js --- plugins/owner-clearTmp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/owner-clearTmp.js b/plugins/owner-clearTmp.js index 7c3d6edfd2..35e6c414fd 100644 --- a/plugins/owner-clearTmp.js +++ b/plugins/owner-clearTmp.js @@ -9,16 +9,16 @@ import { let handler = async (m, { conn, __dirname, args }) => { -m.reply(`โœ… The folder was cleaned *tmp + sessions*`) +m.reply(`โœ… The folder was cleaned *tmp + session*`) m.react(done) const tmp = [tmpdir(), join(__dirname, '../tmp')] const filename = [] tmp.forEach(dirname => readdirSync(dirname).forEach(file => filename.push(join(dirname, file)))) //session bot - readdirSync("./sessions").forEach(file => { + readdirSync("./session").forEach(file => { if (file !== 'creds.json') { - unlinkSync("./sessions/" + file, { recursive: true, force: true })}}) + unlinkSync("./session/" + file, { recursive: true, force: true })}}) return filename.map(file => { unlinkSync(file)