How to check if the bot has Permission X inside of the server? For example VIEW_AUDIT_LOG

In a listener
7 Replies
chillihero
chillihero16mo ago
discord-js.utilities has some nice methods but none to check if the audit log permission is there (havent checked fully tho)
Lioness100
Lioness10016mo ago
I would think guild.me.permissions.has(...)
Favna
Favna16mo ago
^ also this is a #discordjs-support question, not sapphire
chillihero
chillihero16mo ago
ah, sorry thought it gets solved with a sapphire plugin
chillihero
chillihero16mo ago
i tried this befor but me does not exist on guild
Fozzie
Fozzie16mo ago
guild.me was moved to guild.members.me in Discord.js v14.
Spinel
Spinel16mo ago
Documentation suggestion for @Chillihero: <:_:898645159934316565> Permissions#has() Checks whether the bitfield has a permission, or multiple permissions.