I need to verify if a user logging into the website has sufficient permissions to modify my bot's behavior on a guild. I used passport-discord to get information on the user, and this is what I got:
{
...
guilds: [
{
id: 'guild id',
name: 'guild name',
icon: 'guild icon',
owner: false,
permissions: 104189504,
features: [Array],
permissions_new: '1037338791488'
}
...
]
}
For confidentiality purposes, I replaced the guild information above "owner". Now my question: How to convert the "permissions" section into an array of the user's permissions ?