mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
Ignore old messages
This commit is contained in:
@@ -49,7 +49,7 @@ class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
await page.exposeFunction('onAddMessageEvent', msg => {
|
||||
if (msg.id.fromMe) return;
|
||||
if (msg.id.fromMe || !msg.isNewMsg) return;
|
||||
this.emit(Events.MESSAGE_CREATE, new Message(this, msg));
|
||||
});
|
||||
|
||||
|
||||
@@ -61,6 +61,12 @@ class Message extends Base {
|
||||
static get WAppModel() {
|
||||
return 'Msg';
|
||||
}
|
||||
|
||||
static get extraFields() {
|
||||
return [
|
||||
'isNewMsg'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
Reference in New Issue
Block a user