JustTemmie / steam-presence

A script that takes the game you're playing on steam and displays it on discord
MIT License
220 stars 15 forks source link

Use the exact same game icon as when playing it natively #52

Closed PatrickSzela closed 1 month ago

PatrickSzela commented 1 month ago

A simple implementation of fetching the exact same game icon as would end up being used when playing it natively on Windows, straight from Discord's CDN.

Since Steam Presence already uses /api/v8/applications/detectable to find game's id, it's possible to reuse that exact id to fetch more info about the game from /api/v8/applications/{id}/rpc, including a hash of the game's icon. Then it's possible to access the actual icon from https://cdn.discordapp.com/app-icons/{id}/{icon}.webp

Here's a response for Baldur's Gate 3 and its icon from Discord's CDN.

I've tested this with a few games and works great so far.

JustTemmie commented 1 month ago

oh that's smart, i never thought of that - thanks for the PR