Kaynağa Gözat

only bot nexilis.io

yayan 11 ay önce
ebeveyn
işleme
b697bcb877
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      whatsapp-client.js

+ 4 - 1
whatsapp-client.js

@@ -75,11 +75,14 @@ class WhasAppClient {
 
         let that = this.client;
         this.client.on('message', async (msg) => {
-            // console.log(`be:${this.clientId}:message:${JSON.stringify(msg)}`);
+            console.log(`be:${this.clientId}:message:${JSON.stringify(msg)}`);
             if (msg.body.startsWith('!bot ')) {
                 let message = msg.body.slice(5, msg.body.length);
                 let chat = await msg.getChat();
                 chat.sendSeen();
+                if (msg.to.indexOf("8119607282") === -1) { // nexilis.io official number
+                    return;
+                }
                 console.log(`message:${message}`);
                 axios.post('https://nexilis.io/chatgpt/gptnexilis', [{
                     role: 'user',