Version 0.4.0-alpha1
This commit is contained in:
@@ -17,6 +17,7 @@ class Player {
|
||||
guildId;
|
||||
channelId;
|
||||
queue;
|
||||
currentResource;
|
||||
constructor(guildId) {
|
||||
if(this.guildId === null) {
|
||||
clog.error("Impossible de créer un Player, car guildId est null")
|
||||
@@ -177,6 +178,23 @@ class Player {
|
||||
|
||||
}
|
||||
|
||||
setDuration(duration) {
|
||||
if(this.checkConnection()) return
|
||||
if(this.queue.current == null) return
|
||||
if(this.currentResource == null) return
|
||||
var maxduration = this.queue.current.duration
|
||||
if(duration > maxduration) return
|
||||
this.player.stop(); // Arrête la lecture actuelle
|
||||
this.player.play(this.currentResource, {
|
||||
startTime: duration * 1000 // Convertit le timecode en millisecondes
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
setCurrentResource(value) {
|
||||
this.currentResource = value;
|
||||
}
|
||||
|
||||
async skip() {
|
||||
|
||||
if(this.checkConnection()) return "no_music"
|
||||
|
Reference in New Issue
Block a user