mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
fix(Guild): sort text, news, and store channels together (#4070)
This commit is contained in:
@@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user