2022-08-02 17:18:47 +05:00
|
|
|
const { SlashCommandBuilder } = require("discord.js");
|
2022-08-03 20:57:54 +05:00
|
|
|
const BaseCommand = require("../../base/BaseCommand");
|
2022-08-02 17:18:47 +05:00
|
|
|
|
|
|
|
class Seek extends BaseCommand {
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../base/JaBa")} client
|
|
|
|
*/
|
|
|
|
constructor(client) {
|
|
|
|
super({
|
|
|
|
command: new SlashCommandBuilder()
|
|
|
|
.setName("seek")
|
|
|
|
.setDescription(client.translate("music/seek:DESCRIPTION"))
|
2023-03-26 18:31:19 +05:00
|
|
|
.setDescriptionLocalizations({ "uk": client.translate("music/seek:DESCRIPTION", null, "uk-UA") })
|
2022-08-03 20:57:54 +05:00
|
|
|
.addIntegerOption(option => option.setName("time")
|
|
|
|
.setDescription(client.translate("music/seek:TIME"))
|
2023-03-26 18:31:19 +05:00
|
|
|
.setDescriptionLocalizations({ "uk": client.translate("music/seek:TIME", null, "uk-UA") })
|
2022-08-02 17:18:47 +05:00
|
|
|
.setRequired(true)),
|
|
|
|
aliases: [],
|
|
|
|
dirname: __dirname,
|
2022-12-15 21:02:38 +05:00
|
|
|
ownerOnly: false,
|
2022-08-02 17:18:47 +05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../../base/JaBa")} client
|
|
|
|
*/
|
|
|
|
async onLoad() {
|
|
|
|
//...
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param {import("../../base/JaBa")} client
|
|
|
|
* @param {import("discord.js").ChatInputCommandInteraction} interaction
|
2022-08-09 23:48:33 +05:00
|
|
|
* @param {Object} data
|
2022-08-02 17:18:47 +05:00
|
|
|
*/
|
|
|
|
async execute(client, interaction) {
|
2023-01-09 01:39:13 +05:00
|
|
|
const time = interaction.options.getInteger("time"),
|
|
|
|
voice = interaction.member.voice.channel;
|
2022-08-02 17:18:47 +05:00
|
|
|
if (!voice) return interaction.error("music/play:NO_VOICE_CHANNEL");
|
2023-01-09 01:39:13 +05:00
|
|
|
|
2023-03-24 00:09:26 +05:00
|
|
|
const queue = client.player.nodes.get(interaction.guildId);
|
2022-08-02 17:18:47 +05:00
|
|
|
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
|
|
|
|
2023-03-24 00:09:26 +05:00
|
|
|
queue.node.seek(time * 1000);
|
2022-11-23 12:38:27 +05:00
|
|
|
interaction.success("music/seek:SUCCESS", {
|
2023-04-20 11:47:47 +05:00
|
|
|
time: `**${time}** ${client.functions.getNoun(time, interaction.translate("misc:NOUNS:SECONDS:1"), interaction.translate("misc:NOUNS:SECONDS:2"), interaction.translate("misc:NOUNS:SECONDS:5"))}`,
|
2022-11-23 12:38:27 +05:00
|
|
|
});
|
2022-08-02 17:18:47 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Seek;
|