Merge branch 'develop' of https://github.com/Androz2091/discord-music into develop
This commit is contained in:
commit
90f9beca37
1 changed files with 21 additions and 0 deletions
|
@ -674,6 +674,27 @@ class Player {
|
||||||
queue.emit('channelEmpty')
|
queue.emit('channelEmpty')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates progress bar of the current song
|
||||||
|
* @param {Queue} queue Queue of the current server
|
||||||
|
* @returns {String}
|
||||||
|
*/
|
||||||
|
createProgressBar(queue) {
|
||||||
|
// stream time of the dispatcher
|
||||||
|
const currentStreamTime = queue.voiceConnection.dispatcher.streamTime
|
||||||
|
// total stream length
|
||||||
|
const totalLength = queue.tracks[0].durationMS
|
||||||
|
// stream progress
|
||||||
|
let index = Math.round((currentStreamTime / totalLength) * 15)
|
||||||
|
// conditions
|
||||||
|
if ((index >= 1) && (index <= 15)) {
|
||||||
|
let bar = `▬▬▬▬▬▬▬▬▬▬▬▬▬▬`.split("")
|
||||||
|
return bar.splice(index, 0, "🔘").join("")
|
||||||
|
} else {
|
||||||
|
return `🔘▬▬▬▬▬▬▬▬▬▬▬▬▬▬`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play a stream in a channel
|
* Play a stream in a channel
|
||||||
|
|
Loading…
Reference in a new issue