Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda