mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53: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
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get url() {
|
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);
|
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
|
* The owner of the guild
|
||||||
* @type {GuildMember}
|
* @type {GuildMember}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ const Endpoints = exports.Endpoints = {
|
|||||||
// guilds
|
// guilds
|
||||||
guilds: `${API}/guilds`,
|
guilds: `${API}/guilds`,
|
||||||
guild: (guildID) => `${Endpoints.guilds}/${guildID}`,
|
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`,
|
guildPrune: (guildID) => `${Endpoints.guild(guildID)}/prune`,
|
||||||
guildEmbed: (guildID) => `${Endpoints.guild(guildID)}/embed`,
|
guildEmbed: (guildID) => `${Endpoints.guild(guildID)}/embed`,
|
||||||
guildInvites: (guildID) => `${Endpoints.guild(guildID)}/invites`,
|
guildInvites: (guildID) => `${Endpoints.guild(guildID)}/invites`,
|
||||||
@@ -136,6 +137,9 @@ const Endpoints = exports.Endpoints = {
|
|||||||
// oauth
|
// oauth
|
||||||
myApplication: `${API}/oauth2/applications/@me`,
|
myApplication: `${API}/oauth2/applications/@me`,
|
||||||
getApp: (id) => `${API}/oauth2/authorize?client_id=${id}`,
|
getApp: (id) => `${API}/oauth2/authorize?client_id=${id}`,
|
||||||
|
|
||||||
|
// emoji
|
||||||
|
emoji: (emojiID) => `${Endpoints.CDN}/emojis/${emojiID}.png`,
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.Status = {
|
exports.Status = {
|
||||||
|
|||||||
Reference in New Issue
Block a user