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

143
Views
Can not access map

I get this error when I execute code ,I want to access server_queue playing

TypeError: Cannot read properties of undefined (reading 'playing')

This is my code:

const server_queue = queue.get(interaction.guild.id);
        if (!server_queue) {
            const server_data = {
                queue: [],
                connection: null,
                dispatcher: null,
                playing: false,
            }
            queue.set(interaction.guild.id, server_data);
            server_data.queue.push(url);
        }
        if (server_queue.playing) {
            return interaction.reply("")
        }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After skipping your first if block when server_queue doesn't exist, you are then trying to access playing on top of the nonexistent server_queue. Try adding and else if block instead of if to ensure you have it.

const server_queue = queue.get(interaction.guild.id);
        if (!server_queue) {
            const server_data = {
                queue: [],
                connection: null,
                dispatcher: null,
                playing: false,
            }
            queue.set(interaction.guild.id, server_data);
            server_data.queue.push(url);
        }
        else if (server_queue.playing) {
            return interaction.reply("")
        }
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!