Skip to content

Commit

Permalink
feat(RichPresenceAssets): add Twitch preview link for largeImageURL (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tipakA authored and SpaceEEC committed Jan 4, 2020
1 parent 155b682 commit bf31b28
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 @@ -312,6 +312,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 this.activity.presence.client.rest.cdn
.AppAsset(this.activity.applicationID, this.largeImage, { format, size });
Expand Down

0 comments on commit bf31b28

Please sign in to comment.