2017-11-25 4 views
0

그래서 discord.js로 ytdl 작업을 시도했습니다. 오류가 발생합니다.ytdl-core로 노래를 재생하려면 discord.js를 얻을 수 없습니다.

(node:6796) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Parameter "url" must be a string, not undefined".

여기가 로봇이 무언가를 해야하는 곳입니다.

본질적 의미
const dispatcher = connection.playStream(ytdl(args[1])) 
.on("end",() => { 
    console.log("song end"); 
}) 
.on("error",() => { 
    console.error(error); 
}); 
+0

ytdl'의 값 (args [1])'이 정의되지 않았습니다 (에러가 당신에게 알려주 듯이). – ext

+0

'args [1]'의 값은 무엇입니까? –

답변

0

"아무것도 'URL'또는 ytdl()의 매개 변수가없는 ((예 ytdl)가 정의된다). null가 나하지 않을 경우 당신은 확인해야합니다.