reflect backend changes for screenshots

This commit is contained in:
bignutty 2024-05-23 22:56:50 +02:00
parent 08b540e2ef
commit 2d84cddca9

View file

@ -48,17 +48,21 @@ module.exports = {
let summaries = res.response.body.summaries.map((m)=>m.split('\n')[0]); let summaries = res.response.body.summaries.map((m)=>m.split('\n')[0]);
return editOrReply(context, createEmbed("defaultNoFooter", context, { let responseEmbed = createEmbed("defaultNoFooter", context, {
author: { author: {
iconUrl: STATIC_ICONS.ai_summary, iconUrl: STATIC_ICONS.ai_summary,
name: 'Key points about the page', name: res.response.body.page_metadata?.title || 'Key points about the page',
url: webUrl[0] url: webUrl[0]
}, },
description: '- ' + summaries.join('\n- '), description: '- ' + summaries.join('\n- '),
footer: { footer: {
text: "Generative AI is experimental. Response may be factually incorrect or biased." text: "Generative AI is experimental. Response may be factually incorrect or biased."
} }
})) });
if(res.response.body.page_metadata.thumbnail) responseEmbed.thumbnail = { url: res.response.body.page_metadata.thumbnail }
return editOrReply(context, responseEmbed)
}catch(e){ }catch(e){
console.log(e) console.log(e)
return editOrReply(context, createEmbed("error", context, e.response.body.error.message)) return editOrReply(context, createEmbed("error", context, e.response.body.error.message))