TypeError Cannot read properties of undefined (reading 'permissions')

Hello, i have this piece of code and i get this error. Code:
if (message.member.roles.cache.has(modRankRole) || message.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR) || message.author.bot) {
//code
}
if (message.member.roles.cache.has(modRankRole) || message.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR) || message.author.bot) {
//code
}
Error: TypeError: Cannot read properties of undefined (reading 'permissions')
2 Replies
Frosty
FrostyOP3y ago
Yes, it's on that line.
chewie
chewie3y ago
show the full error
Want results from more Discord servers?
Add your server