Closed Bulbul6827738392748287 closed 1 year ago
using store
https://github.com/WhiskeySockets/Baileys#implementing-a-data-store
Thanks thanks for the advice I will try it
i had the same problem and i solved it with this script (CommonJS)
const store = makeInMemoryStore({});
store.readFromFile('./baileys_store.json');
setInterval(() => {
store.writeToFile('./baileys_store.json');
}, 10_000);
const sock = makeWASocket({});
store.bind(sock.ev);
sock.ev.on('chats.set', () => {
console.log('got chats', store.chats.all());
});
sock.ev.on('contacts.set', () => {
console.log('got contacts', Object.values(store.contacts));
});
Help me to solve the problem, Waiting for this message
restart aja nanti juga normal
Help me to solve the problem, Waiting for this message
Restart your phone or your bot
i had the same problem and i solved it with this script (CommonJS)
const store = makeInMemoryStore({}); store.readFromFile('./baileys_store.json'); setInterval(() => { store.writeToFile('./baileys_store.json'); }, 10_000); const sock = makeWASocket({}); store.bind(sock.ev); sock.ev.on('chats.set', () => { console.log('got chats', store.chats.all()); }); sock.ev.on('contacts.set', () => { console.log('got contacts', Object.values(store.contacts)); });
using getMessage
Help me to solve the problem, Waiting for this message