queue.size() is not a function

Using this code here (the player passed in is valid):
const tracks = player.queue;
//if there are no other tracks, information
if (!tracks.size())
return message.reply({embeds : [new MessageEmbed()
.setAuthor(`Queue for ${message.guild.name} - [ ${player.queue.size()} Tracks ]`, message.guild.iconURL({
dynamic: true
}))
.setColor(es.color).addField(eval(client.la[ls]["cmds"]["music"]["queue"]["variablex_1"]), eval(client.la[ls]["cmds"]["music"]["queue"]["variable1"]))
.setDescription(eval(client.la[ls]["cmds"]["music"]["queue"]["variable2"]))
]}).then(async (msg) => {
setTimeout(()=>{try {
msg.delete().catch(() => null);
} catch {}
}, 5000)
})
const tracks = player.queue;
//if there are no other tracks, information
if (!tracks.size())
return message.reply({embeds : [new MessageEmbed()
.setAuthor(`Queue for ${message.guild.name} - [ ${player.queue.size()} Tracks ]`, message.guild.iconURL({
dynamic: true
}))
.setColor(es.color).addField(eval(client.la[ls]["cmds"]["music"]["queue"]["variablex_1"]), eval(client.la[ls]["cmds"]["music"]["queue"]["variable1"]))
.setDescription(eval(client.la[ls]["cmds"]["music"]["queue"]["variable2"]))
]}).then(async (msg) => {
setTimeout(()=>{try {
msg.delete().catch(() => null);
} catch {}
}, 5000)
})
It throws that tracks.size is not a function even though it is clearly stated to be a function in the GitHub code at that position.
10 Replies
1Lucas1.apk
1Lucas1.apk•2y ago
queue.size is a get method
xenial-black
xenial-blackOP•2y ago
So I just ... queue.get("size")?
1Lucas1.apk
1Lucas1.apk•2y ago
Get method and as if it were a parameter, no need to use ()
xenial-black
xenial-blackOP•2y ago
so... just queue.size? I don't quite understand the syntax. Sorry
1Lucas1.apk
1Lucas1.apk•2y ago
Any questions you ask the server bot, if it doesn't solve it, you create a post ok
1Lucas1.apk
1Lucas1.apk•2y ago
Ele resolverá alguns problemas mais eficiente que eu 😌
No description
1Lucas1.apk
1Lucas1.apk•2y ago
He will solve some problems more efficiently than me 😌
xenial-black
xenial-blackOP•2y ago
Oh oops sorry didn't see that
1Lucas1.apk
1Lucas1.apk•2y ago
Have a great day : D
xenial-black
xenial-blackOP•2y ago
You too Thanks again For your help

Did you find this page helpful?