Skip to content

Commit

Permalink
fix: resolving string bitfield (#9262)
Browse files Browse the repository at this point in the history
fix: resolving bitfield

Co-authored-by: space <spaceeec@yahoo.com>
  • Loading branch information
jaw0r3k and SpaceEEC committed Apr 1, 2023
1 parent ab3328a commit 7987565
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/discord.js/src/util/BitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ class BitField {
if (bit instanceof BitField) return bit.bitfield;
if (Array.isArray(bit)) return bit.map(p => this.resolve(p)).reduce((prev, p) => prev | p, DefaultBit);
if (typeof bit === 'string') {
if (this.Flags[bit] !== undefined) return this.Flags[bit];
if (!isNaN(bit)) return typeof DefaultBit === 'bigint' ? BigInt(bit) : Number(bit);
if (this.Flags[bit] !== undefined) return this.Flags[bit];
}
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
}
Expand Down

0 comments on commit 7987565

Please sign in to comment.