Sending a user a DM
im trying to send a embed to a user's DM when they get a certain role. It use to work but now i get an error for line 11 saying "Cannot read properties of undefined (reading 'members')"
Then i use member.user.send(WelcomeEmbed) to send the embed
Versions:
Node.js: 16.18.0
Discordd.js: 14.11.0
6 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.is your interaction a message because afaik .mentions isnt a property on an interaction
nooo.. its the command
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
there is no .mentions property on a CommandInteraction
and thats why you get the error
because .mentions doesnt exist
wierd wonder why it didnt give me an error earlier