Closed tiagoandrepro closed 3 years ago
Em backend/src/libs/wbot.ts Adicione esse codigo
import { handleMessage } from "../services/WbotServices/wbotMessageListener";
const syncUnreadMessages = async (wbot: Session) => {
const chats = await wbot.getChats();
chats.forEach(async chat => {
if (chat.unreadCount > 0) {
const unreadMessages = await chat.fetchMessages({
limit: chat.unreadCount
});
unreadMessages.forEach(msg => {
handleMessage(msg, wbot);
});
}
});
};
syncUnreadMessages(wbot);
testa ai e me fala
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Opa meu amigo, pelo que entendi, esse code vai importar as mensagens não lidas no whatsapp, certo? Precisava trazer o histórico da conversa (mensagens antigas), consegue me ajudar?
In the chat implementation according to issue #129 it is interesting to load all the old WhatsApp conversations. Do you have any resources or tips to implement this feature?