13 Replies
If i remember right those bits are number based not string
theyre string coming from the API call
my question is more about using discordjs types to not check directly like i do in the code right now
it's a bitfield, you can parse it as a bigint and use the bitwise and to check if the bit is present for the position you want
https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
oh ok i get it, thanks!


im using discordrest.get which returns it as a string
thanks so much, ive never worked with bitfields directly
this works already
:waveBoye:
that doesn't answer my question though
if you want to work with raw data entirely you can use @discordjs/core
@discordjs/rest doesnt have PermissionsBitField
im not using @discordjs
PermissionsBitField.Flags is a re-export of PermissionFlagsBits from discord-api-types
unless you're not only using Flags, but then I'd say you could copy the functionality you need instead
i chose REST because its an API endpoint not a bot use-case
oh im being dumb and the main package has exports for them anyway