mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
fix(Guild): sort text, news, and store channels together (#4070)
This commit is contained in:
parent
2e5a6476d5
commit
fcacf1bc0d
1 changed files with 7 additions and 1 deletions
|
|
@ -1335,7 +1335,13 @@ class Guild extends Base {
|
||||||
_sortedChannels(channel) {
|
_sortedChannels(channel) {
|
||||||
const category = channel.type === ChannelTypes.CATEGORY;
|
const category = channel.type === ChannelTypes.CATEGORY;
|
||||||
return Util.discordSort(
|
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),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue