feat(RichPresenceAssets): add Twitch preview link for largeImageURL (#3655)

This commit is contained in:
tipakA
2020-01-05 00:50:38 +01:00
committed by SpaceEEC
parent 155b682f6c
commit bf31b28ad9

View File

@@ -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 });