How would I send an interaction user a message DM?

Currently trying to send a user a DM, I've had a quick scope at the docs and Noticed createDM, Not sure on how I would go about on doing this though hence the question to this server.
7 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
d.js docs
d.js docs12mo ago
method User#send() Sends a message to this user.
H4RDY
H4RDYOP12mo ago
@duck Thought this was how you done this, thank you for clarifying.
duck
duck12mo ago
just to clarify in case you're curious, createDM is called internally by <User>.send() in order to fetch/create appropriate dm channel in the event it isn't cached
H4RDY
H4RDYOP12mo ago
Ah, Perfect, thank you! How would I also catch wether the DMs are open etc
duck
duck12mo ago
<User>.send() will reject Just catch the error
H4RDY
H4RDYOP12mo ago
Thank you
Want results from more Discord servers?
Add your server