mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: handle picture change events
This commit is contained in:
@@ -152,6 +152,17 @@ const startSock = async() => {
|
||||
console.log(events['chats.update'])
|
||||
}
|
||||
|
||||
if(events['contacts.update']) {
|
||||
for(const contact of events['contacts.update']) {
|
||||
if(typeof contact.imgUrl !== 'undefined') {
|
||||
const newUrl = contact.imgUrl === null ? null : await sock!.profilePictureUrl(contact.id!)
|
||||
console.log(
|
||||
`contact ${contact.id} has a new profile pic: ${newUrl}`,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(events['chats.delete']) {
|
||||
console.log('chats deleted ', events['chats.delete'])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user