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
d.js toolkit
d.js toolkit16mo ago
• 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.
treble/luna
treble/luna16mo ago
is your interaction a message because afaik .mentions isnt a property on an interaction
MrFangs
MrFangs16mo ago
nooo.. its the command
treble/luna
treble/luna16mo ago
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.
treble/luna
treble/luna16mo ago
there is no .mentions property on a CommandInteraction and thats why you get the error because .mentions doesnt exist
MrFangs
MrFangs16mo ago
wierd wonder why it didnt give me an error earlier
Want results from more Discord servers?
Add your server