1

I am trying to make an direct message application bot and the bot stops answering after I type first questions answer the bot does not continue the application the code was working good before I updated my discord.js version from v12 to v13

and here is my code :

 let userApplications = {}

  client.on('messageCreate', async function (message) {

if (message.author.equals(client.user)) return;
let emojii = "<a:emoji_66:840679078951911475>"
let emoji = "<a:greencheck:714998866952323122>"
let wemoji = "<a:pp62:730039453380378674>"
let authorId = message.author.id;

if (message.content === "-تسجيل") {
  message.reply("head to dm");
  if (!(authorId in userApplications)) {
    userApplications[authorId] = { "step": 1 }
    message.author.send("whats your name?");
  }

} else {

  if (message.channel.type === "dm" && authorId in userApplications) {
    let authorApplication = userApplications[authorId];

    if (authorApplication.step == 1) {
      authorApplication.answer1 = message.content;
      
      message.author.send("age?");
      authorApplication.step++;
    }
    else if (authorApplication.step == 2) {
      authorApplication.answer2 = message.content;
      message.author.send("birth date");
      authorApplication.step++;
    }
    else if (authorApplication.step == 3) {
      authorApplication.answer3 = message.content;
      message.author.send("birth place");
      authorApplication.step++;
    }
    else if (authorApplication.step == 4) {
      authorApplication.answer4 = message.content;

    message.reply("done");

      delete userApplications[authorId];

    }
  }
}
});

0 Answers0