WhatsApp“presence”和“typing”Javascript函数

WhatsApp“presence”和“typing”Javascript函数,javascript,whatsapp,whatsapi,Javascript,Whatsapp,Whatsapi,为了在whatsApp中获取用户的在线/离线状态和键入状态,我使用了Store.Presence.find phonenumber+'@c.us'。函数{console.logr}函数在检索resultng对象后,我总是得到错误的离线状态,因为我用我的电话号码来验证 那么,WhatsAPI中最新的在线/离线状态显示功能和键入功能是什么 var check = window.setInterval( function() { Store.Presence.find( pho

为了在whatsApp中获取用户的在线/离线状态和键入状态,我使用了Store.Presence.find phonenumber+'@c.us'。函数{console.logr}函数在检索resultng对象后,我总是得到错误的离线状态,因为我用我的电话号码来验证

那么,WhatsAPI中最新的在线/离线状态显示功能和键入功能是什么

    var check = window.setInterval( function() {
        Store.Presence.find( phonenumber + '@c.us' ).then(  function(d) {
            if (d.isOnline) {
                console.log( phonenumber + " is ONLINE" );
                // do something with it
            }
        });
    } , 2000);

还在工作

[WhatsAPI]是聊天API的一部分,这是一个PHP库,那么您为什么要问javascript???@JonasW。我甚至没有意识到这一点,我通过JS学习了whatsApp的功能,到目前为止,我看到的大多数示例都是JS,甚至是github。与PHP相比,大多数情况下都有JS库。我连接到WhatsApp Web,直接在控制台中编写JS代码,这样我就可以看到即时结果,这就是背后的原因。你确定它工作吗?当我测试它时,它不会产生任何结果,并且在控制台中说未定义。