mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-21 13:09:16 +00:00
working pkgs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const { Client, LocalAuth } = require('whatsapp-web.js')
|
||||
const { ProviderClass } = require('@bot-whatsapp/core')
|
||||
|
||||
const { cleanNumber, generateImage } = require('./utils')
|
||||
const { cleanNumber, generateImage, isValidNumber } = require('./utils')
|
||||
|
||||
class WebWhatsappProvider extends ProviderClass {
|
||||
vendor
|
||||
@@ -60,7 +60,17 @@ class WebWhatsappProvider extends ProviderClass {
|
||||
},
|
||||
{
|
||||
event: 'message',
|
||||
func: (payload) => this.emit('message', payload),
|
||||
func: (payload) => {
|
||||
if (payload.from === 'status@broadcast') {
|
||||
return
|
||||
}
|
||||
|
||||
if (!isValidNumber(payload.from)) {
|
||||
return
|
||||
}
|
||||
|
||||
this.emit('message', payload)
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user