I'm having a problem with discord-player. When I execute !play URL
, it joins my channel, it plays the song and it's perfectly fine, but when instead of passing a link I pass a search query ex. !play Despacito
, it gets frozen and then cancels the play event. What is going on? On the video I have a program called NetLimiter4 that is monitoring how much bandwidth is used by any app. You can see that when I type in despacito it tries to search it and then gives up, but when I provide a link, it starts to play it. I checked everything, I even tried to put breakpoints in the Player class. From my observations, it tries to search the query, and it's successful but for some reason, it fails. No stack trace, no nothing
import * as Discord from "discord.js";
import {Player} from "discord-player";
const client = new Discord.Client();
const player = new Player(client);
client.on("ready", ()=>{
console.log("ready");
})
client.on("message", async (message)=>{
let args = message.content.split(" ");
if(args[0] == "!play" && args[1]){
console.log("playin0");
await player.play(message, args[1]);
console.log("playing");
}else if(args[0] == "!stop"){
if(!player.isPlaying(message)) return message.channel.send("Can't stop playing nothing");
player.stop(message);
}
})
player.on("trackStart", (message, track) =>{
message.channel.send(`Started playing ${track.title}!`);
})
client.login("token");