This commit is contained in:
Travis CI 2016-12-02 00:34:01 +00:00
parent 464ede757d
commit db4b457175
2 changed files with 18 additions and 4 deletions

View file

@ -165,7 +165,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`,
@ -206,6 +207,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 = {
@ -1775,7 +1779,7 @@ class Emoji {
* @readonly
*/
get url() {
return `${Constants.Endpoints.CDN}/emojis/${this.id}.png`;
return Constants.Endpoints.emoji(this.id);
}
/**
@ -5559,6 +5563,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}

File diff suppressed because one or more lines are too long