yayan 1 anno fa
parent
commit
fa0d60563e
1 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  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);
+                });
         });
     }
 }