Бот Discord должен реагировать на свой собственный дм, который он послал - PullRequest
0 голосов
/ 14 апреля 2020

Итак, я хочу спросить, что я должен написать, чтобы мой бот реагировал на свой собственный дм, который он послал

const Discord = require('discord.js');
const { prefix, token } = require('./config.json');
const client = new Discord.Client();

client.on('ready', () => {
    console.log('Ready!');
})

try{
    client.on('guildMemberAdd', member => {
    member.send(`Hello ${member}, welcome to the PotatoHost Server! 
I want to help you and so my question is: Do you want to buy a server or do you need more informations first? \n
A: I want to buy a server
B: I need more informations first \n
Please react to this message with A or B.`);
    message.react('?')
    })} catch(error){
    member.guild.channels.get("699374469977735208").send(`Hello ${member}, welcome to the PotatoHost Server!`);
    }

client.login(token);

1 Ответ

0 голосов
/ 14 апреля 2020

Вам нужно использовать функцию .then, чтобы реагировать на сообщения бота:

member.send('Hello ${member}, welcome to the PotatoHost Server! 
I want to help you and so my question is: Do you want to buy a server or do you need more informations first? \n
A: I want to buy a server
B: I need more informations first \n
Please react to this message with A or B.');
.then(function (message) {
message.react("?")
message.react("?")
            })
...