How to get Member Object with message
Im trying to get a member of the author's message but i cant find the way. What i want to do is check if member has a role, i delete the role from passing some time since i added it. But without the member object, i cannot check it. What is the way for getting it?
17 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.https://pasteb.in/?599a8070876b1045#Dqu9rik767c8qrC4F3Nj5c1K5AAZMH486Aq7qsq31d61
Here you have the code from the event
any doubt tell me
Message#member
Represents the author of the message as a guild member. Only available if the message comes from a guild where the author is still a member
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
im watching link rn
im using message.member so i dont know why i cannot acces cache
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
by the way, on code that i shared appears "if (message.member.roles.has('1002155715256909895') === true) {" but im using message.member.roles.cache.has
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
in line 46
TypeError: Cannot read properties of undefined (reading 'cache')
if i delete cache puts has is not a function or something similar
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ok, im going to try
Here's the guild member object
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i had an skill issue on line 40
i commited some changes before creating the post and i forgot to edit that line for ussing the new message object
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i coded the thing to hasty, the most part of the things seems fixed, im making changes until everything works fine
if i note that i cannot solve something i tell
everything is working fine
thnx and srry, practically the problem was that i coded bad