From feb15fdc68ef31fa11efec63e052a0af1c620c95 Mon Sep 17 00:00:00 2001 From: Lluis Date: Sun, 4 Feb 2024 00:33:57 +0100 Subject: [PATCH] image refresh --- handlers/stream.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handlers/stream.js b/handlers/stream.js index 5a4f4f3..d71ab30 100644 --- a/handlers/stream.js +++ b/handlers/stream.js @@ -46,7 +46,9 @@ class Stream { const horas = diff.hours > 0 ? `${diff.hours} horas ` : '' const duration = `${horas}${diff.minutes} minutos` - const image = `[\u200c](${stream.thumbnail_url.replace('-{width}x{height}', '')})` + const width = Math.floor(Math.random() * (1280 - 1000 + 1) + 1000) + const height = width / (16/9) + const image = `[\u200c](${stream.thumbnail_url.replace('-{width}x{height}', `-${width}x${height}`)})` const link = `[${twitchUrl}${stream.user_name}](${twitchUrl}${stream.user_name})` const title = `🔴 *¡EN DIRECTO!*` return `${image} ${title} ${link} \n _${stream.title}_ (${duration})`