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

217
Visualizações
How do i update this command to v13 i tried multiple ways but did not succeed

I don't get any responce after the answer is sent. How do i fix it?

 const ws = require('../../configs/words.json');
    const word = ws[Math.floor(Math.random() * ws.length)];
    const filter = response => {
        return word.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
    };

    message.channel.send(word.question).then(() => {
        message.channel.awaitMessages(filter, { max: 1, time: 600000, errors: ['time'] })
            .then(collected => {
                message.reply(`${collected.first().author} got the correct answer! + 1 tickets!`);
            })
            .catch(collected => {
                message.channel.send('Noone has guessed the word in time.');
            });
    });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try this, its rebuilt a little but should function the same:

const ws = require('../../configs/words.json');
const word = ws[Math.floor(Math.random() * ws.length)];
const filter = response => {
    return word.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
};

message.channel.send(word.question).then(() => {
    return message.channel.awaitMessages({
        filter,
        max: 1,
        time: 600000,
        errors: ['time']
    }).catch(() => {
        throw new Error('Timed Out')
    }).then(collected => {
        message.reply(`${collected.first().author} got the correct answer! + 1 tickets!`);
        })
        .catch(error => {
            switch (error.message) {
                case 'Timed Out':
                    message.channel.send('Noone has guessed the word in time.');
                break
        })
about 4 years ago · Juan Pablo Isaza Relatório
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