forked from phaticusthiccy/WhatsAsenaDuplicated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qr.js
40 lines (34 loc) · 1.49 KB
/
qr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Copyright (C) 2020 Yusuf Usta.
Licensed under the GPL-3.0 License;
you may not use this file except in compliance with the License.
WhatsAsena - Yusuf Usta
*/
const chalk = require('chalk');
const {WAConnection, MessageOptions, MessageType, Mimetype} = require('@adiwajshing/baileys');
const {StringSession} = require('./whatsasena/');
const fs = require('fs');
async function whatsAsena () {
const conn = new WAConnection();
const Session = new StringSession();
conn.version = [3, 3234, 9]
conn.logger.level = 'warn';
conn.regenerateQRIntervalMs = 50000;
conn.on('connecting', async () => {
console.log(`${chalk.green.bold('Whats')}${chalk.blue.bold('Asena')}
${chalk.white.italic('AsenaString Kodu Alıcı')}
${chalk.blue.italic('ℹ️ Connecting to Whatsapp... Please Wait.')}`);
});
conn.on('open', async () => {
var st = Session.createStringSession(conn.base64EncodedAuthInfo());
console.log(
chalk.green.bold(conn.user.jid.startsWith('90') || conn.user.jid.startsWith('994') ? 'WhatsAsena String Kodunuz: ' : 'WhatsAsena String Code: '), st
);
if (!fs.existsSync('config.env')) {
fs.writeFileSync('config.env', `ASENA_SESSION="${st}"`);
}
console.log(conn.user.jid.startsWith('90') || conn.user.jid.startsWith('994') ? 'Bu Kodu Kimseyle Paylaşma ' + conn.user.name : 'Dont Share This Code to Anyone ' + conn.user.name)
process.exit(0);
});
await conn.connect();
}
whatsAsena()