question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

my play command don't work

See original GitHub issue

hello in my bot i have added a command “play”

let queue = await client.player.getQueue(message.guild.id).lenght;
if(!message.member.voiceChannel) return message.channel.send("❌ | Error: You're not in a voice channel !")
if(!args[0]) return message.channel.send("❌ | Error: please add a music name !")
if(queue > 30) return message.channel.send("🛑 | Error: you can't add more than 30 music, please subscribe to the premium to increase this limit")
if(client.player.isPlaying(message.guild.id)){

    let song = await client.player.addToQueue(message.guild.id, args[0]);

 const embedok = new Discord.RichEmbed()
.setDescription(`__**✅ Added to queue 🎶**__\n  » ${song.name}`)
.setAuthor(`requested by ${message.author.tag}`, message.author.avatarURL)
.setTimestamp()
message.channel.send(embedok)
} else {
    let song = await client.player.play(message.member.voiceChannel, args[0])
    const embedok1 = new Discord.RichEmbed()
    .setDescription(`__**✅ Now playing 🎶**__\n  » ${song.name}`)
    .setTimestamp()
    message.channel.send(embedok1)
}

but this don’t work

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SoulHarsh007commented, Feb 19, 2020

You can add this:
if(!message.member.voice.channel) return message.channel.send('you are not in a vc!');

1reaction
thrace19commented, Feb 19, 2020

Replace this exports.run = (client, message, args) => { with exports.run = async (client, message, args) => {

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run "play" command - java - Stack Overflow
The Answer: The command "play" alone is not the full command. You need to add new, run, or help after it. (Important: You...
Read more >
/played command not working? : r/wow - Reddit
I've recently bought the subscription with 2 of my friends and I've levelled way more than my friends, so I wanted to check...
Read more >
"Play the News" command not working - Google Assistant ...
I have a Pixel 3XL and for a couple of months the "Play the News" command keeps breaking. Assistant says "Playing the latest...
Read more >
Why does my /play and /sc command not work - Hypixel
So for my /sc command to check stats quickly in Duels, when I do it, it does nothing, no message in chat, noe...
Read more >
Dfplayer mini play command does not work - Arduino Forum
Anyone got an MP3 player & code that works? Help with coding a DFMiniPlayer with Arduino and a Button. Help Needed For My...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found