[core] Handle WhatsApp News profile picture

This commit is contained in:
devlikepro committed 2025-07-01 13:23:32 +07:00
1 parent 364e55d477
commit cb413febaa
1 file changed
+10 -3
+10 -3
View File
@@ -682,10 +682,17 @@ export abstract class WhatsappSession {
}
protected async refreshProfilePicture(id: string) {
let fn: Promise<string>;
if (isJidBroadcast(id)) {
this.logger.debug(`Refreshing profile picture for id "${id}"...`);
// Have no pictures
if (id === '0@c.us' || id === '0@s.whatsapp.net') {
return null;
} else if (isJidNewsletter(id)) {
} else if (isJidBroadcast(id)) {
return null;
}
// Find the right method
let fn: Promise<string>;
if (isJidNewsletter(id)) {
fn = this.channelsGetChannel(id).then(
(channel: Channel) => channel.picture || channel.preview,
);