mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
Фикс
This commit is contained in:
parent
c8e916a439
commit
de6942ee57
3 changed files with 7 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
||||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
const { SlashCommandBuilder } = require("discord.js");
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
const BaseCommand = require("../../base/BaseCommand");
|
||||||
|
|
||||||
class Back extends 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) 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 });
|
if (!queue.previousTracks[0]) return interaction.error("music/back:NO_PREV_SONG", null, { ephemeral: true });
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
queue.back();
|
||||||
.setAuthor({
|
interaction.success("music/back:SUCCESS");
|
||||||
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] }));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
|
const { SlashCommandBuilder } = require("discord.js");
|
||||||
const BaseCommand = require("../../base/BaseCommand");
|
const BaseCommand = require("../../base/BaseCommand");
|
||||||
|
|
||||||
class Skip extends BaseCommand {
|
class Skip extends BaseCommand {
|
||||||
|
@ -36,25 +36,8 @@ class Skip extends BaseCommand {
|
||||||
const queue = client.player.getQueue(interaction.guildId);
|
const queue = client.player.getQueue(interaction.guildId);
|
||||||
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
||||||
|
|
||||||
const skipped = queue.skip();
|
queue.skip();
|
||||||
if (skipped) {
|
interaction.success("music/skip:SUCCESS");
|
||||||
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]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,7 @@ class Stop extends BaseCommand {
|
||||||
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
||||||
|
|
||||||
queue.destroy();
|
queue.destroy();
|
||||||
interaction.reply({
|
interaction.success("music/stop:SUCCESS");
|
||||||
content: interaction.translate("music/stop:SUCCESS")
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue