From be3892ab520a487e1f650157f3cdb9d97381bd59 Mon Sep 17 00:00:00 2001 From: almostSouji Date: Sun, 18 Apr 2021 13:28:14 +0200 Subject: [PATCH] refactor(WelcomeScreen): move assignment into constructor the data is never patched --- src/structures/WelcomeScreen.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/structures/WelcomeScreen.js b/src/structures/WelcomeScreen.js index e842f4026745..22f620fd2191 100644 --- a/src/structures/WelcomeScreen.js +++ b/src/structures/WelcomeScreen.js @@ -18,30 +18,17 @@ class WelcomeScreen extends Base { */ this.guild = guild; - this._patch(data); - } - - /** - * Builds the welcome screen with the provided data. - * @param {*} data The raw data of the welcome screen - * @private - */ - _patch(data) { - if (!data) return; - /** * The description of this welcome screen * @type {?string} */ this.description = data.description ?? null; - if (!this.welcomeChannels) { - /** - * Collection of welcome channels belonging to this welcome screen - * @type {Collection} - */ - this.welcomeChannels = new Collection(); - } + /** + * Collection of welcome channels belonging to this welcome screen + * @type {Collection} + */ + this.welcomeChannels = new Collection(); for (const channel of data.welcome_channels) { const welcomeChannel = new WelcomeChannel(this.guild, channel);