Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

423
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!