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

271
Visualizações
discord.js v13 Cannot send a message to all the members in the same vc (except bots and the host)

I am trying to make a similar game as the known game Mafia/werewolf and I only need the bot to send a specific text (mafia) to a specific number of users in the VC and the rest I want them to get the same message (good). However, I don't want the (killers) to receive the (good) message again.

client.on("message", (msg) => {
    if (msg.content.startsWith(prefix + "Game")) {
        if (!msg.channel.guild) return;

        let channel = msg.member.voiceChannel;

        let toCheck = channel.members;
        let random1 = toCheck.random();
        let randomE = toCheck.random();

        random1.send("killer");
        msg.channel.send(`${random1} killer`);

        randomE.send("good");
        msg.channel.send(`${randomE} good`);
    }
});
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