簡體   English   中英

解決問題:檢查已記錄

[英]Solve issue: Checking is logged

我正在使用node jsvenom-bot測試 whatsapp bot,並且代碼保持處理Cheking is logged...並且永遠不會停止。

CMD - 打印

在第一次嘗試中,代碼運行正常,向我顯示了 Whatsapp 的 QRCode,但是,一旦我掃描它,關閉程序並重新啟動,代碼就在Checking is logged中。

這是我在index.js文件中的代碼:

// Supports ES6
// import { create, Whatsapp } from 'venom-bot';
const venom = require('venom-bot');

venom
  .create('test-user')
  .then((client) => start(client))
  .catch((error) => { console.log(error); });

function start(client) {
  client.onMessage((message) => {
    if (message.body === 'Hi' && message.isGroupMsg === false) {
      client
        .sendText(message.from, 'Welcome Venom 🕷')
        .then((result) => {
          console.log('Result: ', result); //return object success
        })
        .catch((error) => {
          console.error('Error when sending: ', error); //return object error
        });
    }
  });
}

問題已在 Venom Git Hub' Repo 中的一個問題中解決: https://github.com/orkestral/venom/issues/782

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM