mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Made (hopefully) all url related methods accept an options objects (#1617)
and removed a leftover in User#avatarURL
This commit is contained in:
@@ -261,16 +261,13 @@ class Guild {
|
||||
|
||||
/**
|
||||
* Gets the URL to this guild's icon
|
||||
* @param {string} [format='webp'] One of `webp`, `png`, `jpg`, `gif`
|
||||
* @param {number} [size=128] One of `128`, '256', `512`, `1024`, `2048`
|
||||
* @param {Object} [options={}] Options for the icon url
|
||||
* @param {string} [options.format='webp'] One of `webp`, `png`, `jpg`
|
||||
* @param {number} [options.size=128] One of `128`, '256', `512`, `1024`, `2048`
|
||||
* @returns {?string}
|
||||
*/
|
||||
iconURL(format, size) {
|
||||
iconURL({ format, size } = {}) {
|
||||
if (!this.icon) return null;
|
||||
if (typeof format === 'number') {
|
||||
size = format;
|
||||
format = 'default';
|
||||
}
|
||||
return Constants.Endpoints.CDN(this.client.options.http.cdn).Icon(this.id, this.icon, format, size);
|
||||
}
|
||||
|
||||
@@ -285,12 +282,14 @@ class Guild {
|
||||
|
||||
/**
|
||||
* The URL to this guild's splash
|
||||
* @type {?string}
|
||||
* @readonly
|
||||
* @param {Object} [options={}] Options for the splash url
|
||||
* @param {string} [options.format='webp'] One of `webp`, `png`, `jpg`
|
||||
* @param {number} [options.size=128] One of `128`, '256', `512`, `1024`, `2048`
|
||||
* @returns {?string}
|
||||
*/
|
||||
get splashURL() {
|
||||
splashURL({ format, size } = {}) {
|
||||
if (!this.splash) return null;
|
||||
return Constants.Endpoints.CDN(this.client.options.http.cdn).Splash(this.id, this.splash);
|
||||
return Constants.Endpoints.CDN(this.client.options.http.cdn).Splash(this.id, this.splash, format, size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user