How to make the Discord bot send a private message

Asked

Viewed 2,844 times

-1

I put the code like this

if (message.content.startsWith('.send')) {
message.guild.member(462005459184910339).createDM()
}

but it doesn’t work, I’m using Discord.js

2 answers

0

Try to use message.author.send to send a message in the DM (remembering that this will get the id of the person who typed the message)

0

utilize message.author.send to send to the user who executed the message. To send to a user client.users.cache.get("ID_Do_Usuário").send("MENSAGEM")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.