From 717e0e963f35b9294bc9093a42104babfd22f6fb Mon Sep 17 00:00:00 2001 From: Jan <66554238+vaporox@users.noreply.github.com> Date: Sun, 12 Dec 2021 22:06:11 +0100 Subject: [PATCH] refactor(Guild): remove duplicate methods (#7100) --- src/structures/AnonymousGuild.js | 10 ++++------ src/structures/Guild.js | 18 ------------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/structures/AnonymousGuild.js b/src/structures/AnonymousGuild.js index 4f723661a23b..5415e548550b 100644 --- a/src/structures/AnonymousGuild.js +++ b/src/structures/AnonymousGuild.js @@ -68,22 +68,20 @@ class AnonymousGuild extends BaseGuild { /** * The URL to this guild's banner. - * @param {ImageURLOptions} [options={}] Options for the Image URL + * @param {StaticImageURLOptions} [options={}] Options for the Image URL * @returns {?string} */ bannerURL({ format, size } = {}) { - if (!this.banner) return null; - return this.client.rest.cdn.Banner(this.id, this.banner, format, size); + return this.banner && this.client.rest.cdn.Banner(this.id, this.banner, format, size); } /** * The URL to this guild's invite splash image. - * @param {ImageURLOptions} [options={}] Options for the Image URL + * @param {StaticImageURLOptions} [options={}] Options for the Image URL * @returns {?string} */ splashURL({ format, size } = {}) { - if (!this.splash) return null; - return this.client.rest.cdn.Splash(this.id, this.splash, format, size); + return this.splash && this.client.rest.cdn.Splash(this.id, this.splash, format, size); } } diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 2bfc381e3677..e975af2c81aa 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -479,15 +479,6 @@ class Guild extends AnonymousGuild { } } - /** - * The URL to this guild's banner. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - bannerURL({ format, size } = {}) { - return this.banner && this.client.rest.cdn.Banner(this.id, this.banner, format, size); - } - /** * The time the client user joined the guild * @type {Date} @@ -497,15 +488,6 @@ class Guild extends AnonymousGuild { return new Date(this.joinedTimestamp); } - /** - * The URL to this guild's invite splash image. - * @param {StaticImageURLOptions} [options={}] Options for the Image URL - * @returns {?string} - */ - splashURL({ format, size } = {}) { - return this.splash && this.client.rest.cdn.Splash(this.id, this.splash, format, size); - } - /** * The URL to this guild's discovery splash image. * @param {StaticImageURLOptions} [options={}] Options for the Image URL