mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
switch to cdn endpoints, add guild splash url (#932)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
6043a1f83a
commit
edfb27f428
@@ -87,7 +87,7 @@ class Emoji {
|
||||
* @readonly
|
||||
*/
|
||||
get url() {
|
||||
return `${Constants.Endpoints.CDN}/emojis/${this.id}.png`;
|
||||
return Constants.Endpoints.emoji(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user