最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

发送按钮在 Whatsapp web js 中不起作用

网站源码admin29浏览0评论

发送按钮在 Whatsapp web js 中不起作用

发送按钮在 Whatsapp web js 中不起作用

出于某种原因它不想发送按钮,我在网上查找但没有找到帮助,这是我的代码:


const { Client, LocalAuth ,MessageMedia, Buttons } = require('whatsapp-web.js');

const client = new Client({
    authStrategy: new LocalAuth()
});

client.on('qr', qr => {
    qrcode.generate(qr, {small: true});
});

client.on('ready', () => {
    console.log('Client is ready!');
});


client.on('message', message => {
    console.log('message from', message.from)
    if (message.body === "!button") {

        let button = new Buttons('Button body',[{body:'bt1'},{body:'bt2'},{body:'bt3'}],'title','footer');
        client.sendMessage(message.from, button);

    }
});
 
client.initialize();
回答如下:

安装使用:

npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list

yarn add github:pedroslopez/whatsapp-web.js#fix-buttons-list
发布评论

评论列表(0)

  1. 暂无评论