How to check if a number (the permission integer) has the manage server permission?
I need to check this, without using discordjs, only the sapphire/bitfield package
I didnt understand the readme good enough, thats why im asking here.
Solution:Jump to solution
Solution
```ts
const p: bigint = BigInt(guild.permissions);
const PermissionsBitField = new BitField(enumToObject(PermissionFlagsBits));
const hasManageGuild =...
4 Replies
from this
"permissions": "2147484672",
Go to https://discord.com/developers/applications then your application -> bot and at the bottom you will have a UI of what permission make what bits.
sapphire/bitfield will never give discord specific names because it's not a discord -targeted library
Please read bitfield's README, it's a type-safe wrapper like Discord.js's which accepts both names and values
The README even has an example using the
PermissionsFlagsBits
object from -types and how to consume itSolution
Solution