Closed joeyk710 closed 1 year ago
For me the issue comes from iterating over an enumeration https://github.com/discordjs/discord.js/blob/b2eec5f9fcf37ebb3b7f87a67a6ee3160c182183/packages/discord.js/src/util/BitField.js#L142
As it has both: names and bits in it
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 #9262, and the issue #9247 both attempt to address this issue, but does not occur on
v14.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. https://github.com/discordjs/discord.js/blob/98420826bc2296fc392f17e8254cf4ad743ff5af/packages/discord.js/src/util/BitField.js#L166-L169On
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. https://github.com/discordjs/discord.js/blob/1b9d07f941dc3edf20cd5e65c56b70d009880893/packages/discord.js/src/util/BitField.js#L166-L169Here 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