E
E
Egor2020-06-20 17:39:30
Node.js
Egor, 2020-06-20 17:39:30

How to send a DM message to a person with a known ID in advance?

Hello. I'm making a bot for Discord on a node, it became necessary to send a private message to a person with a known ID, regardless of who sent the command to the bot on the server.

Example. My friend writes the !help command in the channel that the bot is connected to, after that the bot should send a private DM message to me, specifically me. (the bot should not respond in the channel)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MyAngelRem, 2020-06-20
@KenKup11

message.guild.members.cache.get('id').send(`text`);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question