|
@@ -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',
|