refactor!: Unpin @discordjs/collection (#10665)

BREAKING CHANGE: discord.js now uses @discordjs/collection v3—a major version increase.
This commit is contained in:
Jiralite
2025-01-13 04:48:30 +00:00
committed by GitHub
parent 101bef1c52
commit 11438c230b
3 changed files with 4 additions and 10 deletions

View File

@@ -66,7 +66,7 @@
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@discordjs/builders": "^1.9.0",
"@discordjs/collection": "1.5.3",
"@discordjs/collection": "workspace:^",
"@discordjs/formatters": "workspace:^",
"@discordjs/rest": "workspace:^",
"@discordjs/util": "workspace:^",

View File

@@ -309,7 +309,7 @@ function resolveColor(color) {
*/
function discordSort(collection) {
const isGuildChannel = collection.first() instanceof GuildChannel;
return collection.sorted(
return collection.toSorted(
isGuildChannel
? (a, b) => a.rawPosition - b.rawPosition || Number(BigInt(a.id) - BigInt(b.id))
: (a, b) => a.rawPosition - b.rawPosition || Number(BigInt(b.id) - BigInt(a.id)),