mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: log all messages.upsert
This commit is contained in:
@@ -105,13 +105,17 @@ const startSock = async() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// received a new message
|
// received a new message
|
||||||
if(events['messages.upsert'] && events['messages.upsert'].type === 'notify') {
|
if(events['messages.upsert']) {
|
||||||
console.log('recv messages ', JSON.stringify(events['messages.upsert'], undefined, 2))
|
const upsert = events['messages.upsert']
|
||||||
for(const msg of events['messages.upsert'].messages) {
|
console.log('recv messages ', JSON.stringify(upsert, undefined, 2))
|
||||||
if(!msg.key.fromMe && doReplies) {
|
|
||||||
console.log('replying to', msg.key.remoteJid)
|
if(upsert.type === 'notify') {
|
||||||
await sock!.sendReadReceipt(msg.key.remoteJid!, msg.key.participant!, [msg.key.id!])
|
for(const msg of upsert.messages) {
|
||||||
await sendMessageWTyping({ text: 'Hello there!' }, msg.key.remoteJid!)
|
if(!msg.key.fromMe && doReplies) {
|
||||||
|
console.log('replying to', msg.key.remoteJid)
|
||||||
|
await sock!.sendReadReceipt(msg.key.remoteJid!, msg.key.participant!, [msg.key.id!])
|
||||||
|
await sendMessageWTyping({ text: 'Hello there!' }, msg.key.remoteJid!)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user