Put GSMArena page from device onto message (based on #9)

This commit is contained in:
Lucas Gabriel 2024-09-08 11:59:11 -03:00
parent 7070a0e51f
commit a10ef8980e
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -110,9 +110,11 @@ function formatPhone(phone) {
.map(([label, key]) => `<b>${label}:</b> <code>${formattedPhone[key]}</code>`) .map(([label, key]) => `<b>${label}:</b> <code>${formattedPhone[key]}</code>`)
.join("\n\n"); .join("\n\n");
const deviceUrl = `<b>GSMArena page:</b> ${formattedPhone.url}`;
const deviceImage = phone.picture ? `<b>Device Image</b>: ${phone.picture}` : ''; const deviceImage = phone.picture ? `<b>Device Image</b>: ${phone.picture}` : '';
return `<b>${formattedPhone.name}</b>\n\n${attributes}\n\n${deviceImage}`; return `<b>\n\nName: </b><code>${formattedPhone.name}</code>\n\n${attributes}\n\n${deviceImage}\n\n${deviceUrl}`;
} }
async function fetchHtml(url) { async function fetchHtml(url) {