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

175
Visualizações
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 à 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