Precondition issue
.
I have this code, but for some reason it deletes the message even if the member has any of the roles in the array
8 Replies
what
"hasAny"
i just use for my staff check function
and then
but yea using
yourconfig.roles.some((role) => <GuildMember>.roles.cache.has(role));
will workty
I actually think using hasAny is a good way to go. Ararou might've been confused because it's a relatively new addition to the Collection API. @_carlos123 could you show your original code?
For example, @Ararou's utility function could be simplified to:
oh
eh
ill test it out in a test build of the bot
and look up on it
i am hardly informed on some changes abt d.js 😅
rest parameters are not d.js
message.member.roles.cache.hasAny(roles)
guessing it would need to be message.member.roles.cache.hasAny(...roles)
Yes
@Carlos1996
So sorry for the ping
@_carlos123 is who I meant
either way