Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

401
Views
Discord.js bot not responding on commands

So I created some code that should make the bot send an embed with what I wrote when the command is executed. It works, however when I answer with what I wrote (which would be test) it does not answer me! I have tried everything but it does not work! Thanks for help in advance.

Here is the code:

const {MessageEmbed} = require("discord.js")
const sdb = require('x73db');
const db = new sdb("points");
module.exports = {
    name: 'fast',
    execute(client, message, args) {
        if(!args [0] ) return message.reply("example : -fast hi ")
      let text = args.join(' ')
const filter = response => {
    return text.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
};
        let embed = new MessageEmbed()
        .setAuthor({ name: `${client.user.tag}`, iconURL: client.user.displayAvatarURL()
 })
        .setThumbnail(message.guild.iconURL())
        .setTitle("fast")
        .setDescription(`**${text}**`)
        .setColor("GREYPLE")
        .setTimestamp()
      .setFooter({ text: client.user.tag , iconURL: message.guild.iconURL()
               })
        message.channel.send({content:`by <@${message.author.id}>`, embeds:[embed]})
      

    message.channel.awaitMessages(filter, {
                  max: 1,
                  time: 20000,
                  errors: ['time']
                }).then(collected => {
      copy1 = collected.first().content;
      won1 = collected.first().author;
      let r1 = db.get(`points_${won1.id}`);
      if (copy1 == text.answers){
        if(!r1) {
          r1 = 0;
          db.set(`points_${won1.id}`, 0);
        }
    message.channel.send(`**${collected.first().author} you did it**`);
    console.log(`[Typing] ${collected.first().author} typed the word.`);
                  copy1 = collected.first().content;
        db.set(`points_${won1.id}`, r1 + 1);
      }else{
                if(!r1) {
          r1 = 0;
          db.set(`points_${won1.id}_trn`, 0);
        } 
         message.channel.send(`**${collected.first().author} you did it**`);
    console.log(`[Typing] ${collected.first().author} typed the word.`);
                  copy1 = collected.first().content;
        db.set(`points_${won1.id}_trn`, r1 + 1);
      }
      })
      .catch(collected=>{
        message.channel.send("time is over..");
      })
    }
  
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!