Skip to content

Commit

Permalink
refactor(Guild): remove duplicate methods (#7100)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporoxx committed Dec 12, 2021
1 parent ee91f5a commit 717e0e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
10 changes: 4 additions & 6 deletions src/structures/AnonymousGuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
18 changes: 0 additions & 18 deletions src/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down

0 comments on commit 717e0e9

Please sign in to comment.