fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 6874869ef8 - Show all commits

View file

@ -1180,11 +1180,10 @@ export class DialogKeywords {
const imageData = await (await fetch(url)).arrayBuffer(); const imageData = await (await fetch(url)).arrayBuffer();
const base64Image = Buffer.from(imageData).toString('base64'); const base64Image = Buffer.from(imageData).toString('base64');
const contentType = mime.lookup(url); const contentType = mime.lookup(url);
const ext = mime.extension(contentType);
reply['attachments'] = []; reply['attachments'] = [];
reply['attachments'].push({ reply['attachments'].push({
name: filename, name: filename,
contentType: ext, contentType: contentType,
contentUrl: `data:${contentType};base64,${base64Image}` contentUrl: `data:${contentType};base64,${base64Image}`
}); });