mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-07 02:05:51 +00:00
fix: support WhatsApp voice message download
This commit is contained in:
parent
614b21368f
commit
0f32c0451e
@ -165,6 +165,10 @@ export class WhatsAppClient {
|
|||||||
fallbackContent = '[Video]';
|
fallbackContent = '[Video]';
|
||||||
const path = await this.downloadMedia(msg, unwrapped.videoMessage.mimetype ?? undefined);
|
const path = await this.downloadMedia(msg, unwrapped.videoMessage.mimetype ?? undefined);
|
||||||
if (path) mediaPaths.push(path);
|
if (path) mediaPaths.push(path);
|
||||||
|
} else if (unwrapped.audioMessage) {
|
||||||
|
fallbackContent = '[Voice Message]';
|
||||||
|
const path = await this.downloadMedia(msg, unwrapped.audioMessage.mimetype ?? undefined);
|
||||||
|
if (path) mediaPaths.push(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
const finalContent = content || (mediaPaths.length === 0 ? fallbackContent : '') || '';
|
const finalContent = content || (mediaPaths.length === 0 ? fallbackContent : '') || '';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user