Version 0.4.0-alpha1

This commit is contained in:
2025-03-02 21:37:04 +01:00
parent 407d9d6b9a
commit 12c4e2740a
5 changed files with 24 additions and 4 deletions

View File

@@ -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"