diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 144c7ef0f..7732b77eb 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -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); } /** diff --git a/src/structures/OAuth2Application.js b/src/structures/OAuth2Application.js index e9d7a8d79..a4d8875c8 100644 --- a/src/structures/OAuth2Application.js +++ b/src/structures/OAuth2Application.js @@ -119,16 +119,13 @@ class OAuth2Application { /** * A link to the application'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} URL to the icon */ - 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).AppIcon(this.id, this.icon, format, size); } diff --git a/src/structures/User.js b/src/structures/User.js index a71b78c04..349c55cb0 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -113,10 +113,6 @@ class User { */ avatarURL({ format, size } = {}) { if (!this.avatar) return null; - if (typeof format === 'number') { - size = format; - format = 'default'; - } return Constants.Endpoints.CDN(this.client.options.http.cdn).Avatar(this.id, this.avatar, format, size); }