How do I convert this a permission int into an PermissionString[]
Hello, I am watching the
GuildAuditLogEntryCreate
event and when a permission is updated i am getting this in the entry
changes: [ { key: 'permissions', old: 8797166764176, new: 8797166764160 } ],
I want to see which permissions has been changes so I hhave seen on the documentation that I can use PermissionsBitsField, I wrote this
But I am getting an error and I dont know what I am doing wrong, thanks for the help
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: 8797166764176.
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPI'm using discord.js v14.16.3 and node v22.8.0
PermissionsBitField takes BigInt, not number
how do i convert it into a BigInt?
Not sure why you aren’t even getting it as string
Afaik, Discord provides permissions as string
Unless ur on an outdated version
ok i've try a string instead and it works thx