已收到 QR <some code>。如何使用此代码连接到 whatsapp web? whatsapp-web.js
QR RECEIVED <some code> . How to connect to whatsapp web with this code? whatsapp-web.js
当我 运行 我的代码时,控制台中的垃圾邮件。 Module - whatsapp-web.js
代码
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
console.log('QR RECEIVED', qr);
});
client.on('message', async(msg) => {
const mentions = await msg.getMentions();
for (let contact of mentions) {
console.log(`${contact.pushname} was mentioned`);
}
});
client.initialize();
如何使用此模块连接到 whatsapp web?
控制台
QR received
1@wCO3HYi6B1wat+cAyHe3+tlzfbjiWNxCTP30fEY16YNgmaBuknL/bBDpMNzA2SgfFPfCgQ==,yycd40PiAgEvrk961s+wiBLoMlsFb/eqVpRTN9Ec3FE=,E37yNJ5fmhoX3G/A==
类似上面的内容出现在控制台中。
这应该可以做到
$ npm i qrcode-terminal
然后
const qrcode = require('qrcode-terminal');
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', qr => {
qrcode.generate(qr, {small: true});
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.initialize();
在 运行 代码后按照上面的回答,一些二维码图像将在你的 console.next 上生成你从右上角的三个虚线图标下转到你的 whatsapp select 'Linked devices' .here 你应该扫描控制台生成的 qrimage 。现在它已准备好发送和接收 msg
当我 运行 我的代码时,控制台中的垃圾邮件。 Module - whatsapp-web.js
代码
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
console.log('QR RECEIVED', qr);
});
client.on('message', async(msg) => {
const mentions = await msg.getMentions();
for (let contact of mentions) {
console.log(`${contact.pushname} was mentioned`);
}
});
client.initialize();
如何使用此模块连接到 whatsapp web?
控制台
QR received
1@wCO3HYi6B1wat+cAyHe3+tlzfbjiWNxCTP30fEY16YNgmaBuknL/bBDpMNzA2SgfFPfCgQ==,yycd40PiAgEvrk961s+wiBLoMlsFb/eqVpRTN9Ec3FE=,E37yNJ5fmhoX3G/A==
类似上面的内容出现在控制台中。
这应该可以做到
$ npm i qrcode-terminal
然后
const qrcode = require('qrcode-terminal');
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', qr => {
qrcode.generate(qr, {small: true});
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.initialize();
在 运行 代码后按照上面的回答,一些二维码图像将在你的 console.next 上生成你从右上角的三个虚线图标下转到你的 whatsapp select 'Linked devices' .here 你应该扫描控制台生成的 qrimage 。现在它已准备好发送和接收 msg