0

So I want to ask what I have to write so that my bot reacts to his own dm that he sent

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);
Nico105
  • 188
  • 1
  • 12

1 Answers1

1

You need to use .then function to react bot message:

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("")
            })
dolor3sh4ze
  • 925
  • 1
  • 7
  • 25