#getting permission name from bitfield
1 messages · Page 1 of 1 (latest)
As far as I know, no you would have to create one yourself
@weak dock
Try salvaging some of this I have:
function getPermsNames(flags) {
const permEntries = Object.entries(Permissions.FLAGS);
const result = [];
for (let [ name, flag ] of permEntries) {
if (flags & flag === 0) continue;
result.push(name);
}
return result;
}
yeah i have working code that gets me permission name from table of permission names that i did
but i'm trying to figure out if there is a simpler way
How are you defining your initial permission(s)?
const permissions = log.target.permissionOverwrites.cache;
permissions.forEach((permission) => {
console.log(permission.allow.bitfield)
});```