yayan 1 년 전
부모
커밋
fa0d60563e
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      whatsapp-client.js

+ 11 - 1
whatsapp-client.js

@@ -117,8 +117,18 @@ class WhasAppClient {
         });
         this.client.on('disconnected', async (reason) => {
             console.log(`be:${this.clientId}:Client was logged out`, reason);
-            await this.client.destroy();
             map.delete(this.clientId);
+            // kirim ke abi untuk update status
+            axios.post('https://nexilis.io/dashboardv2/logics/update_whatsapp_login', {
+                be: this.clientId,
+                status: 0
+            })
+                .then(function (response) {
+                    console.log(`response: ${response.data}`);
+                })
+                .catch(function (error) {
+                    console.log(error);
+                });
         });
     }
 }