From 003c1ebeb6b2f5849882fdfbca8a2dc19894bf0f Mon Sep 17 00:00:00 2001 From: Teamolduser <120130487+Teamolduser@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:49:06 +0530 Subject: [PATCH] Update index.js --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3fea31c..32fd4fb 100644 --- a/index.js +++ b/index.js @@ -102,8 +102,13 @@ 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}) + console.log(chalk.greenBright("DONE!")); - await fs.emptyDir("./" + sessionName); + await fs.emptyDir("./" + sessionName); process.exit(1); } else if ( connection === "close" && @@ -113,7 +118,7 @@ async function ZyyPairing() { lastDisconnect.error.output.statusCode !== 401 ) { ZyyPairing(); - await fs.emptyDir("./" + sessionName); + await fs.emptyDir("./" + sessionName); } }, );