whatsapp-web.js
whatsapp-web.js copied to clipboard
feat: get message by id
did some tests
For reference: Starts failing on 20 hours (70971 seconds)
the "message" that got success was 18 days ago, and the type is: 'e2e_notification'
messageId, IfGotTheMessage, timeSpent, timeDiference
For reference: Starts failing on 20 hours (70971 seconds)
the "message" that got success was 18 days ago, and the type is: 'e2e_notification'
messageId, IfGotTheMessage, timeSpent, timeDiference
that's some extensive testing
It's failing randomly, if someone notices a patern please help us (got messageId from msgstore.db select timestamp,key_remote_jid,key_id,key_from_me,media_wa_type from messages order by timestamp desc limit 1000
)
When trying to get an old message, I get null. And this message is really not deleted.
When trying to get an old message, I get null. And this message is really not deleted.
Does this happen always? There is also a chance that the chat has been cleared etc.. Make sure you can search for it via the search bar...
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.
Any chance this works on MD?
Any chance this works on MD?
Haha, no. This would only fetch messages stored in the storage of a linked device. No fetching from phone
I need this feature please merge it as soon as possible
What about
const msg = await this.pupPage.evaluate(async messageId => { let msg = window.Store.Msg.get(messageId); if(msg) return window.WWebJS.getMessageModel(msg); const params = messageId.split('_'); if(params.length !== 3) throw new Error('Invalid serialized message id specified'); const chatId = params[1]; const chat = window.Store.Chat.get(chatId); while (chat.msgs._models.find(msg => msg.id._serialized === messageId)) { await chat.loadEarlierMsgs(); } msg = window.Store.Msg.get(messageId); if(msg) return window.WWebJS.getMessageModel(msg); }, messageId); if(msg) return new Message(this, msg); return null; }
@pedroslopez This way seems working
@pedroslopez is there any estimation for merging this PR?
@pedroslopez this PR is planned to merge? or what workaround you can recommend me?
Closing after merge of #1634