I'm making a music bot and I wanted it to send an embed message with some details about the music and the voice channel itself but I can't figure out how to make it send the bitrate of the voice channel. I've read the documentation and there's various parts where .bitrate shows up but for some reason every time I tried something like insert class here.bitrate I get this error: Cannot read properties of undefined (reading 'bitrate').
Here's my code:
.on("playSong", (queue, song) =>
queue.textChannel.send({
embeds: [
new Discord.MessageEmbed()
.setTitle('🎶Reproduciendo🎶')
.setDescription(song.name)
.setColor('#FF5733')
.addFields(
{ name: 'Mandado por', value: `${song.user}`, inline: true },
{ name: 'Duración', value: `${song.formattedDuration}`, inline: true },
{ name: 'Queue', value: `${queue.songs.length} canción(es)`, inline: true },
// =======> { name: 'Bitrate', value: `This gets and sends the bitrate of the voice channel the bot is connected to or was called from`, inline: true },
{ name: 'Loop', value: `${queue.repeatMode ? (queue.repeatMode === 2 ? "Queue" : "Canción") : "Apagado"}`, inline: true },
{ name: 'Autoplay', value: `${queue.autoplay ? "Prendido" : "Apagado"}`, inline: true },
{ name: 'Filtros activados actualmente', value: `${queue.filters.join(", ") || "Ninguno"}`}
)
]
})
)
Thanks in advance! (Sorry if there's already a similar question or if you had a stroke reading this. English is my fourth language and thus I still don't have a good vocabulary).