mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
possible loadMessage fix
This commit is contained in:
@@ -117,9 +117,6 @@ WAConnectionTest('Misc', (conn) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
it('should load a single message', async () => {
|
it('should load a single message', async () => {
|
||||||
const loaded = await conn.loadMessage (testJid, '5A3FF17786EBCD0EF350')
|
|
||||||
assert.equal (loaded.key.id, '5A3FF17786EBCD0EF350')
|
|
||||||
|
|
||||||
const {messages} = await conn.loadMessages (testJid, 10)
|
const {messages} = await conn.loadMessages (testJid, 10)
|
||||||
for (var message of messages) {
|
for (var message of messages) {
|
||||||
const loaded = await conn.loadMessage (testJid, message.key.id)
|
const loaded = await conn.loadMessage (testJid, message.key.id)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export class WAConnection extends Base {
|
|||||||
jid: string,
|
jid: string,
|
||||||
count: number,
|
count: number,
|
||||||
before?: { id?: string; fromMe?: boolean },
|
before?: { id?: string; fromMe?: boolean },
|
||||||
mostRecentFirst = true
|
mostRecentFirst: boolean = true
|
||||||
) {
|
) {
|
||||||
jid = whatsappID(jid)
|
jid = whatsappID(jid)
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ export class WAConnection extends Base {
|
|||||||
null,
|
null,
|
||||||
]
|
]
|
||||||
const response = await this.query({json, binaryTags: [WAMetric.queryMessages, WAFlag.ignore], expect200: true})
|
const response = await this.query({json, binaryTags: [WAMetric.queryMessages, WAFlag.ignore], expect200: true})
|
||||||
const messages = response[2] ? (response[2] as WANode[]).map((item) => item[2] as WAMessage) : []
|
const messages = response[2] ? (response[2] as WANode[]).map(item => item[2] as WAMessage) : []
|
||||||
|
|
||||||
return messages
|
return messages
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user