refactor: new node features (#5132)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Sugden
2021-06-30 21:40:33 +01:00
committed by GitHub
parent f108746c15
commit 1e8f01253e
68 changed files with 305 additions and 360 deletions

View File

@@ -75,7 +75,7 @@ class GuildPreview extends Base {
* The description for this guild
* @type {?string}
*/
this.description = data.description || null;
this.description = data.description ?? null;
if (!this.emojis) {
/**
@@ -97,8 +97,7 @@ class GuildPreview extends Base {
* @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);
}
/**
@@ -107,8 +106,7 @@ class GuildPreview extends Base {
* @returns {?string}
*/
discoverySplashURL({ format, size } = {}) {
if (!this.discoverySplash) return null;
return this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size);
return this.discoverySplash && this.client.rest.cdn.DiscoverySplash(this.id, this.discoverySplash, format, size);
}
/**
@@ -117,8 +115,7 @@ class GuildPreview extends Base {
* @returns {?string}
*/
iconURL({ format, size, dynamic } = {}) {
if (!this.icon) return null;
return this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic);
return this.icon && this.client.rest.cdn.Icon(this.id, this.icon, format, size, dynamic);
}
/**