enhanced setUserLimit to reset when passing null to stay consistent with other methods (#2083)

* added a new check to setUserLimit so it won't silently fail anymore if you put a wrong type in

* adapt spaces idea of converting null to 0

* this way it looks cleaner

* and i need to remove this

* need to do it that way because like Gus said null will not change anyhting

* space prooved me wrong and idk why ist working now
This commit is contained in:
Yukine
2017-11-10 01:30:13 +01:00
committed by Crawl
parent 05a41b5ca4
commit 62544905a0

View File

@@ -293,7 +293,7 @@ class GuildChannel extends Channel {
topic: data.topic,
nsfw: data.nsfw,
bitrate: data.bitrate || (this.bitrate ? this.bitrate * 1000 : undefined),
user_limit: data.userLimit != null ? data.userLimit : this.userLimit, // eslint-disable-line eqeqeq
user_limit: typeof data.userLimit !== 'undefined' ? data.userLimit : this.userLimit,
parent_id: data.parentID,
lock_permissions: data.lockPermissions,
permission_overwrites: data.permissionOverwrites,