roydejong / timbot

🤖 Discord bot that announces Twitch channels going live
MIT License
102 stars 38 forks source link

Thumbnail view broken? #20

Open KJThaDon opened 3 years ago

KJThaDon commented 3 years ago

Not sure what's going on but the thumbnail for Cold War seems to just have a loading icon forever. When clicking and going to the full link it shows fine in the browser

https://static-cdn.jtvnw.net/ttv-boxart/Call%20of%20Duty:%20Black%20Ops%20Cold%20War-288x384.jpg

error

Also, is there a way to keep the preview image attached when the stream ends too?

Thank you!

roydejong commented 3 years ago

Broken cover art

I've seen this happen as well, and I'm not entirely sure why.

It should be noted that external images are proxied through Discord servers (through https://images-ext-2.discordapp.net/external/ or something similar), which is most likely where things are breaking.

One possibility is that we're hitting some kind of rate limit or issue because of how often the live post gets edited, and the images are re-fetched, but frankly I don't have a solution right now.

Keeping the live embed

Issue with keeping the live preview is that it stops working sometime after the stream ends, the image gets replaced by an empty / gray image on Twitch's server, so that's why it's currently getting removed once a stream goes offline.

It'd be rather complicated because the bot would have to cache the image itself and/or make it available via a server somehow.

GoudronViande24 commented 3 years ago

It is probably due to a bug on Discord's side, because the image is rendered with the image URL by the Discord server, and not by the bot. You should try to open Discord in another browser, or with a different account and see if it loads.

roydejong commented 3 years ago

It is probably due to a bug on Discord's side, because the image is rendered with the image URL by the Discord server, and not by the bot.

I think so too but regardless I'd like to see if we can fix this on the bot's end, as this is a relatively common issue.