mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
Динамическое обновление очереди
This commit is contained in:
parent
045ce8ff8c
commit
9136500baa
1 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,7 @@ class Queue extends BaseCommand {
|
||||||
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
if (!queue) return interaction.error("music/play:NOT_PLAYING");
|
||||||
|
|
||||||
let currentPage = 0;
|
let currentPage = 0;
|
||||||
const embeds = generateQueueEmbed(interaction, queue);
|
let embeds = generateQueueEmbed(interaction, queue);
|
||||||
|
|
||||||
const row = new ActionRowBuilder()
|
const row = new ActionRowBuilder()
|
||||||
.addComponents(
|
.addComponents(
|
||||||
|
@ -77,6 +77,7 @@ class Queue extends BaseCommand {
|
||||||
if (i.isButton()) {
|
if (i.isButton()) {
|
||||||
if (i.customId === "queue_prev_page") {
|
if (i.customId === "queue_prev_page") {
|
||||||
i.deferUpdate();
|
i.deferUpdate();
|
||||||
|
if (embeds != generateQueueEmbed(interaction, queue)) embeds = generateQueueEmbed(interaction, queue);
|
||||||
|
|
||||||
if (currentPage !== 0) {
|
if (currentPage !== 0) {
|
||||||
--currentPage;
|
--currentPage;
|
||||||
|
@ -91,6 +92,7 @@ class Queue extends BaseCommand {
|
||||||
}
|
}
|
||||||
} else if (i.customId === "queue_next_page") {
|
} else if (i.customId === "queue_next_page") {
|
||||||
i.deferUpdate();
|
i.deferUpdate();
|
||||||
|
if (embeds != generateQueueEmbed(interaction, queue)) embeds = generateQueueEmbed(interaction, queue);
|
||||||
|
|
||||||
if (currentPage < embeds.length - 1) {
|
if (currentPage < embeds.length - 1) {
|
||||||
currentPage++;
|
currentPage++;
|
||||||
|
@ -105,6 +107,7 @@ class Queue extends BaseCommand {
|
||||||
}
|
}
|
||||||
} else if (i.customId === "queue_jump_page") {
|
} else if (i.customId === "queue_jump_page") {
|
||||||
i.deferUpdate();
|
i.deferUpdate();
|
||||||
|
if (embeds != generateQueueEmbed(interaction, queue)) embeds = generateQueueEmbed(interaction, queue);
|
||||||
|
|
||||||
const msg = await interaction.followUp({
|
const msg = await interaction.followUp({
|
||||||
content: interaction.translate("music/queue:PAGE_TO_JUMP", {
|
content: interaction.translate("music/queue:PAGE_TO_JUMP", {
|
||||||
|
|
Loading…
Reference in a new issue