From 62544905a06152ca769c4e6d5f16337b134ac67e Mon Sep 17 00:00:00 2001 From: Yukine Date: Fri, 10 Nov 2017 01:30:13 +0100 Subject: [PATCH] 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 --- src/structures/GuildChannel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 896e2bdf8..a84ad0847 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -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,