Please describe the problem you are having in as much detail as possible:
Having this issue using GuildMember.hasPermission
Include a reproducible code sample here, if possible:
guildMember.hasPermission("ADMINISTRATOR")
Issue:
Code : BITFIELD_INVALID
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
at Function.resolve (/home/koyamie/Koya/node_modules/discord.js/src/util/BitField.js:150:11)
at Permissions.has (/home/koyamie/Koya/node_modules/discord.js/src/util/BitField.js:45:28)
at Permissions.has (/home/koyamie/Koya/node_modules/discord.js/src/util/Permissions.js:38:85)
at /home/koyamie/Koya/node_modules/discord.js/src/structures/GuildMember.js:263:47
at Map.some (/home/koyamie/Koya/node_modules/@discordjs/collection/dist/index.js:194:17)
at GuildMember.hasPermission (/home/koyamie/Koya/node_modules/discord.js/src/structures/GuildMember.js:263:23)
at /home/koyamie/Koya/koyabot.js:143:69
at new Promise (<anonymous>)
Further details:
Copy pasting your coda sample does not give said error.
If i didn't miss anything, in order to get that error, whatever you passed as parameter had to be none of number, BitField, array or a string that would be listed in https://github.com/discordjs/discord.js/blob/master/src/util/Permissions.js#L77
Copy pasting your coda sample does not give said error.
If i didn't miss anything, in order to get that error, whatever you passed as parameter had to be none of number, BitField, array or a string that would be listed in https://github.com/discordjs/discord.js/blob/master/src/util/Permissions.js#L77
Ok so MANAGE_SERVER changed to MANAGE_GUILD when I updated the repo, my bad then didnt noticed, thank you (closing issue)
thanks! really needed this
Most helpful comment
Ok so MANAGE_SERVER changed to MANAGE_GUILD when I updated the repo, my bad then didnt noticed, thank you (closing issue)