From c523e224d73f6acb15cc2603a173d9b2d7dc8317 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 9 Sep 2017 16:43:02 -0500 Subject: [PATCH] fix sorting things (#1922) * fix sorting things * Update Guild.js --- src/structures/Guild.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 21ec24ed1..7c8f6852d 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -1132,10 +1132,9 @@ class Guild extends Base { } _sortedChannels(channel) { - if (channel.type === Constants.ChannelTypes.CATEGORY) { - return Util.discordSort(this.channels.filter(c => c.type === Constants.ChannelTypes.CATEGORY)); - } - return Util.discordSort(this.channels.filter(c => c.parent === channel.parent)); + const category = channel.type === Constants.ChannelTypes.CATEGORY; + return Util.discordSort(this.channels.filter(c => + c.type === channel.type && (category || c.parent === channel.parent))); } }