You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing the method BitField#toArray(), this is suppose to return only the Array of BitField names based on the bit given. The actual result returns the bitfield itself as a string as well as the bitfield name, which is the expected result.
It would appear that PermissionsBitField#toArray() does not have this issue from testing, but other extended BitField classes do. This does show the expected result with the permission bitfield name only.
Code sample
AccesstheflagsfromauserwithUserFlagsBitField#toArray()andtheclient's intents with IntentsBitField#toArray().
Tested code:
- message.author.flags.toArray()
- message.client.options.intents.toArray()
Which package is this bug report for?
discord.js
Issue description
When accessing the method BitField#toArray(), this is suppose to return only the Array of BitField names based on the bit given. The actual result returns the bitfield itself as a string as well as the bitfield name, which is the expected result.
The PR fix: resolving string bitfield #9262, and the issue Incorrect resolve of bits in
BitField
#9247 both attempt to address this issue, but does not occur onv14.8.0
and is shown below. I am unsure why this change was necessary since I was not experiencing these issues at all in previous versions.discord.js/packages/discord.js/src/util/BitField.js
Lines 166 to 169 in 9842082
On
v14.9.0
, this has line 167 moved to line 168 (shown below), which is indeed causing an issue with the bitfield and bitfield name showing together.discord.js/packages/discord.js/src/util/BitField.js
Lines 166 to 169 in 1b9d07f
Here is the result I got on
v14.9.0
accessing UserFlagsBitField#toArray()This is the temporary workaround I made so the bitfield is removed from the array:
Code sample
Package version
v14.9.0
Node.js version
v18.5.0
Operating system
Linux arm64
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
User, Channel, Message
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildModeration, GuildPresences, GuildMessages, MessageContent
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: