Skip to content

Commit

Permalink
refactor(WelcomeScreen): move assignment into constructor
Browse files Browse the repository at this point in the history
the data is never patched
  • Loading branch information
almostSouji committed Apr 18, 2021
1 parent 4111474 commit 627fb8e
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/structures/WelcomeScreen.js
Expand Up @@ -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<Snowflake, WelcomeChannel>}
*/
this.welcomeChannels = new Collection();
}
/**
* Collection of welcome channels belonging to this welcome screen
* @type {Collection<Snowflake, WelcomeChannel>}
*/
this.welcomeChannels = new Collection();

for (const channel of data.welcome_channels) {
const welcomeChannel = new WelcomeChannel(this.guild, channel);
Expand Down

0 comments on commit 627fb8e

Please sign in to comment.