Made seek more precise, added notice to readme

This commit is contained in:
Essem 2021-11-09 17:42:18 -06:00
parent 0aafe950f7
commit ef5023b639
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
3 changed files with 3 additions and 5 deletions

View file

@ -10,10 +10,10 @@ class SeekCommand extends MusicCommand {
const player = this.connection.player;
const track = await Rest.decode(player.node, player.track);
if (!track.isSeekable) return "This track isn't seekable!";
const seconds = parseInt(this.args[0]);
const seconds = parseFloat(this.args[0]);
if (isNaN(seconds) || (seconds * 1000) > track.length || (seconds * 1000) < 0) return "That's not a valid position!";
player.seek(seconds * 1000);
return `🔊 Seeked track to ${seconds} seconds.`;
return `🔊 Seeked track to ${seconds} second(s).`;
}
static description = "Seeks to a different position in the music";