fix(Guild): sort text, news, and store channels together (#4070)

This commit is contained in:
Advaith
2020-04-16 01:35:19 -07:00
committed by GitHub
parent 2e5a6476d5
commit fcacf1bc0d

View File

@@ -1335,7 +1335,13 @@ class Guild extends Base {
_sortedChannels(channel) {
const category = channel.type === ChannelTypes.CATEGORY;
return Util.discordSort(
this.channels.cache.filter(c => c.type === channel.type && (category || c.parent === channel.parent)),
this.channels.cache.filter(
c =>
(['text', 'news', 'store'].includes(channel.type)
? ['text', 'news', 'store'].includes(c.type)
: c.type === channel.type) &&
(category || c.parent === channel.parent),
),
);
}
}