mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Load Message Fix
This commit is contained in:
@@ -88,11 +88,15 @@ export default class WhatsAppWebMessages extends WhatsAppWebGroups {
|
|||||||
return response as {status: number, stamp: string}
|
return response as {status: number, stamp: string}
|
||||||
}
|
}
|
||||||
async loadMessage (jid: string, messageID: string) {
|
async loadMessage (jid: string, messageID: string) {
|
||||||
const messages = await this.loadConversation (jid, 1, {id: messageID, fromMe: false}, false)
|
let messages
|
||||||
var index = null
|
try {
|
||||||
if (messages.length > 0) {
|
messages = await this.loadConversation (jid, 1, {id: messageID, fromMe: true}, false)
|
||||||
index = {id: messages[0].key.id, fromMe: false}
|
} catch {
|
||||||
|
messages = await this.loadConversation (jid, 1, {id: messageID, fromMe: false}, false)
|
||||||
}
|
}
|
||||||
|
var index = null
|
||||||
|
if (messages.length > 0) index = messages[0].key
|
||||||
|
|
||||||
const actual = await this.loadConversation (jid, 1, index)
|
const actual = await this.loadConversation (jid, 1, index)
|
||||||
return actual[0]
|
return actual[0]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,16 +69,6 @@ WAClientTest('Messages', (client) => {
|
|||||||
await createTimeout (2000)
|
await createTimeout (2000)
|
||||||
await client.clearMessage (messages[0].key)
|
await client.clearMessage (messages[0].key)
|
||||||
})
|
})
|
||||||
it ('should load convo', async () => {
|
|
||||||
/*const [chats] = await client.receiveChatsAndContacts ()
|
|
||||||
for (var i in chats) {
|
|
||||||
if (chats[i].jid.includes('@g.us')) {
|
|
||||||
console.log (chats[i].jid)
|
|
||||||
const data = await client.groupCreatorAndParticipants (chats[i].jid)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Validate WhatsApp IDs', () => {
|
describe('Validate WhatsApp IDs', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user