#issue with code
1 messages · Page 1 of 1 (latest)
idk if this helps but I logged message.member.roles.cache.has(moderation.modRole) and it returned false (3 times too)
message.member will be undefined in DMs
im running it on a guild
Is it always giving the error? Or just sometimes
I would say, to fix it, just replace message.member.roles.cache.has(moderation.modRole) with message.member?.roles.cache.has(moderation.modRole)
That will also account for if there isn't message.member for any reason
didn't work, it ran the console.log twice and the error was thrown 3 times
i think I fixed it, it was just that it was detecting the bot's message too
still need to figure out the data problem, but this problem is fixed
Thank you for marking this question as solved!
Learn more