Add queue stream time

This commit is contained in:
Androz2091 2021-01-22 09:04:33 +01:00
parent 3374835951
commit 00f77fbd67
2 changed files with 7 additions and 3 deletions

View file

@ -668,9 +668,7 @@ class Player extends EventEmitter {
if (!queue) return
const timecodes = options && typeof options === 'object' ? options.timecodes : false
// Stream time of the dispatcher
const currentStreamTime = queue.voiceConnection.dispatcher
? queue.voiceConnection.dispatcher.streamTime + queue.additionalStreamTime
: 0
const currentStreamTime = queue.currentStreamTime
// Total stream time
const totalTime = queue.playing.durationMS
// Stream progress

View file

@ -97,6 +97,12 @@ class Queue extends EventEmitter {
get calculatedVolume () {
return this.filters.bassboost ? this.volume + 50 : this.volume
}
get currentStreamTime () {
return this.voiceConnection.dispatcher
? this.voiceConnection.dispatcher.streamTime + this.additionalStreamTime
: 0
}
}
module.exports = Queue