使用whatsapp-web.js 向 WhatsApp 频道发送消息

问题描述 投票:0回答:1

由于没有关于使用 API 向 Whatsapp 频道发送消息的文档,我尝试了这个库“whatsapp-web.js”(它使用 Puppeteer 来运行 Whatsapp Web 的真实实例),但对我来说不起作用,..另一方面,非常适合向我的号码发送消息..这是代码:

const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('ready', () => {
    console.log('Client is ready!');

     client.sendMessage("12xxxxxxxxxxxxx@newsletter", "testtttttttttt");  //id hidden for security
      
});
client.initialize();

有什么解决方案或解决方法吗?

javascript node.js whatsapp whatsapi
1个回答
0
投票

你是如何找到频道ID的?

© www.soinside.com 2019 - 2024. All rights reserved.