mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix(RichPresenceAssets): add Twitch preview link for largeImageURL (#3715)
This commit is contained in:
@@ -243,6 +243,8 @@ class RichPresenceAssets {
|
|||||||
if (!this.largeImage) return null;
|
if (!this.largeImage) return null;
|
||||||
if (/^spotify:/.test(this.largeImage)) {
|
if (/^spotify:/.test(this.largeImage)) {
|
||||||
return `https://i.scdn.co/image/${this.largeImage.slice(8)}`;
|
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)
|
return Endpoints.CDN(this.game.presence.client.options.http.cdn)
|
||||||
.AppAsset(this.game.applicationID, this.largeImage);
|
.AppAsset(this.game.applicationID, this.largeImage);
|
||||||
|
|||||||
Reference in New Issue
Block a user