fix: receive messages on chatwoot

This commit is contained in:
Davidson Gomes 2024-10-18 17:43:43 -03:00
parent bc751bbb6b
commit 84451ba3e0

View File

@ -2042,7 +2042,8 @@ export class ChatwootService {
return;
}
if (adsMessage) {
const isAdsMessage = (adsMessage && adsMessage.title) || adsMessage.body || adsMessage.thumbnailUrl;
if (isAdsMessage) {
const imgBuffer = await axios.get(adsMessage.thumbnailUrl, { responseType: 'arraybuffer' });
const extension = mime.getExtension(imgBuffer.headers['content-type']);