ookamiiixd / baileys-api

Simple WhatsApp REST API with multiple device support
MIT License
431 stars 327 forks source link

How to disable insert chat history after scan qr? #156

Closed rahmat-why closed 1 year ago

rahmat-why commented 1 year ago

the size of chat data is too large

luispimenta commented 1 year ago

@ookamiiixd where can we disable this?

ookamiiixd commented 1 year ago

Yes, you can. The simplest way would be just turn this code:

const store = new Store(sessionId, socket.ev);

into:

const store = new Store(sessionId, socket.ev).unlisten();

That should unbind all event listener from the store immediately. But of course if you want to achieve the best performance, you have to remove all of the store related codes (initialization, access, etc)