This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
legacy-musicbot/commands/music/seek.js
2021-09-23 22:22:33 +02:00

22 lines
833 B
JavaScript

const ms = require('ms');
module.exports = {
name: 'seek',
aliases: [],
utilisation: '{prefix}seek [time]',
voiceChannel: true,
async execute(client, message, args) {
const queue = player.getQueue(message.guild.id);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
const timeToMS = ms(args.join(' '));
if (timeToMS >= queue.current.durationMS) return message.channel.send(`The indicated time is higher than the total time of the current song ${message.author}... try again ? ❌\n*Try for example a valid time like **5s, 10s, 20 seconds, 1m**...*`);
await queue.seek(timeToMS);
message.channel.send(`Time set on the current song **${ms(timeToMS, { long: true })}** ✅`);
},
};