Documentation - Collection - default version is not default installed version #10777
Closed
synchro-calc
started this conversation in
General
Replies: 1 comment 1 reply
-
Not sure what the issue is here. If you want 1.5.3 documentation, use it: https://discord.js.org/docs/packages/collection/1.5.3 If you mean "main" is not 1.5.3, then that would also be wrong—main is the main branch, currently in development. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When installing discord.js from npm, the version of the Collection module it requires (& installs by default) is
v1.5.3
.The online documentation over at https://discord.js.org/docs (https://discord.js.org/docs/packages/collection/main/Collection:Class) for the collection class uses the latest version of the Collection module documentation (currently
v2.1.1
).This leads to incorrect information regarding the method
intersection()
, because it doesn't exist in discord.js !In fact, this method was named
intersect()
inv1.5.3
, and it seems to have been renamed later on.Example
When fetching roles for a guild, one ends up with a collection of members for each role, and if one tries to intersect the members of one role with another using
roleA.members.intersection(roleB.members)
like the documentation suggests, a TypeError is thrown.Summary
When installing the latest version of discord.js from npm, the documentation I'm linked to regarding the Collection class is set to the wrong version.
Beta Was this translation helpful? Give feedback.
All reactions