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

412
Visualizações
How to see size of voice channels that my bot is currently in (joined)?

How could I add the current size of voice channel connections to my /info command? I tried using console.log and logging client.voice.adapters, but still didn't manage to figure it out. I know that this is a simple question, but maybe answers from you guys will help others, thanks!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I didn't manage to find an answer to my question, but I came up with a solution. I found a way that works for me and is easier than looking for code chunks or asking questions.

  • Here's a tip: If you make silly mistakes as I did, check the docs.
    In this case ( Discord.js.org and MDN Web Docs ).

What did I do / how to?

  1. Create a new Map();
  2. Use <Map>.set and <Map>.delete to add and remove a number.
  3. Use else if(newState.status === "idle") { 4th step } to check if the new state status is equal to Idle.
  4. Add the <Map>.delete(interaction.guild.name, <numberToRemove>); function into 3th step function to remove one number from the map.

Copy and Paste if you are too lazy:

Function for adding a number to map should look like this: <MapName>.set(interaction.guild.name, <numberToAdd>);

Function for deleting a number from map looks like this: <MapName>.delete(interaction.guild.name, <numberToRemove>);

about 4 years ago · Juan Pablo Isaza Relatório

0

client.voice.adapters maps guild ids to voice adapters. It returns a Map and Maps have a size property that returns the number of elements in that Map.

Would this work?

client.voice.adapters.size
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