discord-player
Advanced tools
Comparing version 2.3.0 to 2.3.1
{ | ||
"name": "discord-player", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Complete framework to facilitate music commands using discord.js v12", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"ytpl": "^0.2.0", | ||
"ytsr": "^0.1.18" | ||
"ytsr": "^0.1.19" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -206,7 +206,8 @@ const ytdl = require('discord-ytdl-core') | ||
} | ||
ytsr(query, (err, results) => { | ||
ytsr(query).then((results) => { | ||
if (results.items.length < 1) return resolve([]) | ||
if (err) return resolve([]) | ||
const resultsVideo = results.items.filter((i) => i.type === 'video') | ||
resolve(allResults ? resultsVideo.map((r) => new Track(r, null, null)) : [new Track(resultsVideo[0], null, null)]) | ||
}).catch(() => { | ||
return resolve([]) | ||
}) | ||
@@ -389,2 +390,3 @@ }) | ||
queue.tracks = [] | ||
if (queue.stream) queue.stream.destroy() | ||
queue.voiceConnection.dispatcher.end() | ||
@@ -766,3 +768,5 @@ // Resolve | ||
// Stream time of the dispatcher | ||
const currentStreamTime = queue.voiceConnection.dispatcher.streamTime + queue.additionalStreamTime | ||
const currentStreamTime = queue.voiceConnection.dispatcher | ||
? queue.voiceConnection.dispatcher.streamTime + queue.additionalStreamTime | ||
: 0 | ||
// Total stream time | ||
@@ -769,0 +773,0 @@ const totalTime = queue.playing.durationMS |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50555
1138
13
Updatedytsr@^0.1.19