issue with code
I have this code and it's returning an error, I already checked by logging and
message.member
is defined, the error was also logged 3 times for some reason
Code: https://pastebin.com/WWMVCewy
Error:7 Replies
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 DMsim 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 reasonSolution
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
marked wrong message oops