Skip to content

Commit

Permalink
fix(RichPresenceAssets): add Twitch preview link for largeImageURL (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC authored Jan 24, 2020
1 parent 903f6ca commit a505a55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/structures/Presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class RichPresenceAssets {
if (!this.largeImage) return null;
if (/^spotify:/.test(this.largeImage)) {
return `https://i.scdn.co/image/${this.largeImage.slice(8)}`;
} else if (/^twitch:/.test(this.largeImage)) {
return `https://static-cdn.jtvnw.net/previews-ttv/live_user_${this.largeImage.slice(7)}.png`;
}
return Endpoints.CDN(this.game.presence.client.options.http.cdn)
.AppAsset(this.game.applicationID, this.largeImage);
Expand Down

0 comments on commit a505a55

Please sign in to comment.