WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.64k stars 1.23k forks source link

[BUG] Waiting for this message #152

Closed Bulbul6827738392748287 closed 1 year ago

Bulbul6827738392748287 commented 1 year ago

Help me to solve the problem, Waiting for this message Screenshot_20230617-194504

Piyoxz commented 1 year ago

using store

Piyoxz commented 1 year ago

https://github.com/WhiskeySockets/Baileys#implementing-a-data-store

Bulbul6827738392748287 commented 1 year ago

https://github.com/WhiskeySockets/Baileys#implementing-a-data-store

Thanks thanks for the advice I will try it

KiroFyzu commented 1 year ago

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));
});
tomiheneldra commented 1 year ago

Help me to solve the problem, Waiting for this message Screenshot_20230617-194504

restart aja nanti juga normal

Riders004 commented 1 year ago

Help me to solve the problem, Waiting for this message Screenshot_20230617-194504

Restart your phone or your bot

Piyoxz commented 1 year ago

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