Finding members with specific emoji in their name problem.
I have this kind of code i made:
But i get this:
TypeError: Cannot read properties of undefined (reading 'includes')
10 Replies
It would be null, not undefined
You should iterate over
members.values()
instead of members
, or else each member
is a [string, GuildMember]
array instead of just a GuildMember
object
(but using displayName is still probably the way to go if you're not doing optional chaining)
So something like thsi?
members.values() is iterable
and for sure it doesn't have displayName poperty
But if i do it like this?
in this case member is array of key and value
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I got it working.
used something like this.
Ignore the count thing.
its filter, you can use forEach instead