Please describe your problem in as much detail as possible:
I would like to make my play command check if the queue is paused, And if it is, it'll resume it just like how its done with bots like Rythm. After reading the docs, I found queue.paused which is a boolean. Can I know what I'm doing wrong here?
Error:
TypeError: Cannot read properties of undefined (reading 'paused')
Code:
const queue = this.bot.player.getQueue(interaction.guildId!)
if(queue.paused) {
const queue = this.bot.player.getQueue(interaction.guildId!)
this.bot.player.resume(interaction.guildId!)
} else {
const search = interaction.options.getString('track')
const ChannelID = interaction.channelId;
const Channel = this.bot.client.channels.cache.get(ChannelID);
const channel = interaction.member.voice.channel;
const member = interaction.member;
if (!channel) {
return interaction.reply('❌ **You have to be in a voice channel to use this command.**')
}
await interaction.reply(`🎵 **Searching** 🔎 \`${search}\``)
await this.bot.player.playVoiceChannel(channel, search, {
textChannel: interaction.channel as any,
member
});
}
Please describe your problem in as much detail as possible: I would like to make my play command check if the queue is paused, And if it is, it'll resume it just like how its done with bots like Rythm. After reading the docs, I found
queue.paused
which is a boolean. Can I know what I'm doing wrong here?Error:
Code:
Further information: