Skip to content

Commit

Permalink
image refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 3, 2024
1 parent 94b6038 commit feb15fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion handlers/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`
Expand Down

0 comments on commit feb15fd

Please sign in to comment.