From b0faec8dbf67379e1e6aaa7ac3b224e7970a0d5f Mon Sep 17 00:00:00 2001 From: rizzlogy Date: Mon, 25 Sep 2023 07:27:10 +0000 Subject: [PATCH] automatic tidy up code --- index.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 32fd4fb..c596b57 100644 --- a/index.js +++ b/index.js @@ -102,13 +102,20 @@ async function ZyyPairing() { "connection.update", async ({ connection, lastDisconnect }) => { if (connection === "open") { - - let file = await socket.sendMessage(socket.user.id, { document: fs.readFileSync('./' + sessionName + '/creds.json'), mimetype:'json', fileName: 'creds.json' } ) - - await socket.sendMessage(socket.user.id, {text: "Upload this session to ur bot multi auth state"}, {quoted: file}) - + let file = await socket.sendMessage(socket.user.id, { + document: fs.readFileSync("./" + sessionName + "/creds.json"), + mimetype: "json", + fileName: "creds.json", + }); + + await socket.sendMessage( + socket.user.id, + { text: "Upload this session to ur bot multi auth state" }, + { quoted: file }, + ); + console.log(chalk.greenBright("DONE!")); - await fs.emptyDir("./" + sessionName); + await fs.emptyDir("./" + sessionName); process.exit(1); } else if ( connection === "close" && @@ -118,7 +125,7 @@ async function ZyyPairing() { lastDisconnect.error.output.statusCode !== 401 ) { ZyyPairing(); - await fs.emptyDir("./" + sessionName); + await fs.emptyDir("./" + sessionName); } }, );