From eecec0aea8804bd485aacb9d94c3724816eac521 Mon Sep 17 00:00:00 2001 From: almostSouji Date: Sat, 23 Jan 2021 17:57:48 +0100 Subject: [PATCH 1/2] fix(GuildChannel): regression on default channel type --- 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 2a2f91248237..163992cb7b51 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -357,7 +357,7 @@ class GuildChannel extends Channel { const newData = await this.client.api.channels(this.id).patch({ data: { name: (data.name || this.name).trim(), - type: data.type ? ChannelTypes[data.type.toUpperCase()] : this.type, + type: data.type ? ChannelTypes[data.type.toUpperCase()] : ChannelTypes[this.type.toUpperCase()], topic: data.topic, nsfw: data.nsfw, bitrate: data.bitrate || this.bitrate, From 4fe579aa694ae1c4a8e78a40609f2f04003fa38f Mon Sep 17 00:00:00 2001 From: almostSouji Date: Sat, 23 Jan 2021 18:10:24 +0100 Subject: [PATCH 2/2] chore: simplify defaulting --- 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 163992cb7b51..f0e9da97faf3 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -357,7 +357,7 @@ class GuildChannel extends Channel { const newData = await this.client.api.channels(this.id).patch({ data: { name: (data.name || this.name).trim(), - type: data.type ? ChannelTypes[data.type.toUpperCase()] : ChannelTypes[this.type.toUpperCase()], + type: ChannelTypes[data.type?.toUpperCase()], topic: data.topic, nsfw: data.nsfw, bitrate: data.bitrate || this.bitrate,