Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

404
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda