diff --git a/src/structures/Emoji.js b/src/structures/Emoji.js index a3f12a867..ca533f929 100644 --- a/src/structures/Emoji.js +++ b/src/structures/Emoji.js @@ -87,7 +87,7 @@ class Emoji { * @readonly */ get url() { - return `${Constants.Endpoints.CDN}/emojis/${this.id}.png`; + return Constants.Endpoints.emoji(this.id); } /** diff --git a/src/structures/Guild.js b/src/structures/Guild.js index ccf146634..f50c1bd98 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -241,6 +241,16 @@ class Guild { return Constants.Endpoints.guildIcon(this.id, this.icon); } + /** + * Gets the URL to this guild's splash (if it has one, otherwise it returns null) + * @type {?string} + * @readonly + */ + get splashURL() { + if (!this.splash) return null; + return Constants.Endpoints.guildSplash(this.id, this.splash); + } + /** * The owner of the guild * @type {GuildMember} diff --git a/src/util/Constants.js b/src/util/Constants.js index 7b3aef275..98cec7918 100644 --- a/src/util/Constants.js +++ b/src/util/Constants.js @@ -95,7 +95,8 @@ const Endpoints = exports.Endpoints = { // guilds guilds: `${API}/guilds`, guild: (guildID) => `${Endpoints.guilds}/${guildID}`, - guildIcon: (guildID, hash) => `${Endpoints.guild(guildID)}/icons/${hash}.jpg`, + guildIcon: (guildID, hash) => `${Endpoints.CDN}/icons/${guildID}/${hash}.jpg`, + guildSplash: (guildID, hash) => `${Endpoints.CDN}/splashes/${guildID}/${hash}.jpg`, guildPrune: (guildID) => `${Endpoints.guild(guildID)}/prune`, guildEmbed: (guildID) => `${Endpoints.guild(guildID)}/embed`, guildInvites: (guildID) => `${Endpoints.guild(guildID)}/invites`, @@ -136,6 +137,9 @@ const Endpoints = exports.Endpoints = { // oauth myApplication: `${API}/oauth2/applications/@me`, getApp: (id) => `${API}/oauth2/authorize?client_id=${id}`, + + // emoji + emoji: (emojiID) => `${Endpoints.CDN}/emojis/${emojiID}.png`, }; exports.Status = {