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

170
Vistas
I can't reply or react to collected message. Discord.js V13

So, I wanted to add command /custom and after that, user would enter they nicknames through messages. Bot should check if ther nickname is in game (async function checkIfSummonerExist(m)) and if it does exist, bot should collect their name and data and push to array (async function getSummonerProfile(m.content)). Now I wanted to add bot reactions to those messages, if nickname exist, it should add one reaction (for example thumbs up), and if name does not exist one should add thumbs down. So I tried with m.react(), but it does not work. I also tried with m.reply("User approved")but I don't get reply. I am new to making discord bot.

const { SlashCommandBuilder } = require("@discordjs/builders");
const { getSummonerProfile } = require("./../functions/summonerData");
const { calculateRank } = require("./../functions/calculateRank");

let arrayOfSummoners = [];
async function checkIfSummonerExist(m) {
  const test = await getSummonerProfile(m.content);

  if (test) {
   
    return true;
  } else {
    return false;
  }
}
module.exports = {
  data: new SlashCommandBuilder()
    .setName("custom")
    .setDescription(
      "Enter the name of the user."
    ),
  async execute(interaction) {
    await interaction.deferReply();
    // `m` is a message object that will be passed through the filter function
    const filter = (m) => checkIfSummonerExist(m);
    const collector = interaction.channel.createMessageCollector({
      filter,
      time: 15000,
    });
      
    collector.on("collect", (m) => {
       m.reply('User approved');
       m.react('😄');
      arrayOfSummoners.push(getSummonerProfile(m.content));
    });

    collector.on("end", (collected) => {
      // return interaction.editReply(`Collected ${collected.size} items`);
    //  calculateRank(arrayOfSummoners);
    });

    //   return interaction.editReply();
  },
};
about 4 years ago · Juan Pablo Isaza
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