Answer the question
In order to leave comments, you need to log in
Discord bot reading private messages from user JS?
Hello. How can I make the bot read messages only from a specific user (let's say by ID), save his message and output them to a specific channel?
Mandatory in JS
Answer the question
In order to leave comments, you need to log in
if (message.channel.type === 'dm') { // если тип канала - DM (личные сообщения) . . .
if (message.author.id === "ID_пользователя") { // если ID пользователя === . . .
client.channels.cache.get('ID_канала').send(`${message.content}`); // находим канал по его ID и отправляем туда контент сообщения.
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question