Skip to content

Commit

Permalink
automatic tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
rizzlogy authored and github-actions[bot] committed Sep 25, 2023
1 parent 5cb6a60 commit b0faec8
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand All @@ -118,7 +125,7 @@ async function ZyyPairing() {
lastDisconnect.error.output.statusCode !== 401
) {
ZyyPairing();
await fs.emptyDir("./" + sessionName);
await fs.emptyDir("./" + sessionName);
}
},
);
Expand Down

0 comments on commit b0faec8

Please sign in to comment.