This commit is contained in:
JonnyBro 2022-08-26 00:31:42 +05:00
parent c8e916a439
commit de6942ee57
3 changed files with 7 additions and 37 deletions

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Back extends BaseCommand {
@ -37,19 +37,8 @@ class Back extends BaseCommand {
if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { ephemeral: true });
if (!queue.previousTracks[0]) return interaction.error("music/back:NO_PREV_SONG", null, { ephemeral: true });
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("music/back:SUCCESS")
})
.setThumbnail(queue.current.thumbnail)
.setDescription(`[${queue.current.title}](${queue.current.url})`)
.setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer
});
queue.back()
.then(() => interaction.reply({ embeds: [embed] }));
queue.back();
interaction.success("music/back:SUCCESS");
}
}

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Skip extends BaseCommand {
@ -36,25 +36,8 @@ class Skip extends BaseCommand {
const queue = client.player.getQueue(interaction.guildId);
if (!queue) return interaction.error("music/play:NOT_PLAYING");
const skipped = queue.skip();
if (skipped) {
const embed = new EmbedBuilder()
.setAuthor({
name: interaction.translate("music/skip:SUCCESS")
})
.setThumbnail(queue.current.thumbnail || null)
.setDescription(interaction.translate("music/play:NOW_PLAYING", {
songName: queue.current.title
}))
.setFooter({
text: client.config.embed.footer
})
.setColor(client.config.embed.color);
interaction.reply({
embeds: [embed]
});
}
queue.skip();
interaction.success("music/skip:SUCCESS");
}
}

View file

@ -37,9 +37,7 @@ class Stop extends BaseCommand {
if (!queue) return interaction.error("music/play:NOT_PLAYING");
queue.destroy();
interaction.reply({
content: interaction.translate("music/stop:SUCCESS")
});
interaction.success("music/stop:SUCCESS");
}
}