feat: Interaction

- add label for the button
This commit is contained in:
Amane Serenetia 2025-02-21 07:31:35 +07:00
parent cbfeef5eb8
commit 740245c29d

View File

@ -33,23 +33,28 @@ module.exports = async (client, player, track) => {
new ButtonBuilder() new ButtonBuilder()
.setCustomId("volumedown") .setCustomId("volumedown")
.setEmoji("🔉") .setEmoji("🔉")
.setLabel("Down")
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("previous") .setCustomId("previous")
.setEmoji("⏮️") .setEmoji("⏮️")
.setLabel("Previous")
.setStyle(ButtonStyle.Secondary) .setStyle(ButtonStyle.Secondary)
.setDisabled(!previous), .setDisabled(!previous),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("pause") .setCustomId("pause")
.setEmoji(player.paused ? "▶️" : "⏸️") .setEmoji(player.paused ? "▶️" : "⏸️")
.setLabel(player.paused ? "Resume" : "Pause")
.setStyle(player.paused ? ButtonStyle.Success : ButtonStyle.Secondary), .setStyle(player.paused ? ButtonStyle.Success : ButtonStyle.Secondary),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("skip") .setCustomId("skip")
.setEmoji("⏭️") .setEmoji("⏭️")
.setLabel("Skip")
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("volumeup") .setCustomId("volumeup")
.setEmoji("🔊") .setEmoji("🔊")
.setLabel("Up")
.setStyle(ButtonStyle.Secondary) .setStyle(ButtonStyle.Secondary)
); );
@ -58,22 +63,27 @@ module.exports = async (client, player, track) => {
new ButtonBuilder() new ButtonBuilder()
.setCustomId("autoplay") .setCustomId("autoplay")
.setEmoji("♾️") .setEmoji("♾️")
.setLabel(player.get("autoplay") ? "Autoplay On" : "Autoplay Off")
.setStyle(player.get("autoplay") ? ButtonStyle.Success : ButtonStyle.Secondary), .setStyle(player.get("autoplay") ? ButtonStyle.Success : ButtonStyle.Secondary),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("loop") .setCustomId("loop")
.setEmoji("🔁") .setEmoji("🔁")
.setLabel(player.repeatMode === "off" ? "Off" : "On")
.setStyle(player.repeatMode === "off" ? ButtonStyle.Secondary : ButtonStyle.Success), .setStyle(player.repeatMode === "off" ? ButtonStyle.Secondary : ButtonStyle.Success),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("stop") .setCustomId("stop")
.setEmoji("⏹️") .setEmoji("⏹️")
.setLabel("Stop")
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("shuffle") .setCustomId("shuffle")
.setEmoji("🔀") .setEmoji("🔀")
.setLabel("Shuffle")
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary),
new ButtonBuilder() new ButtonBuilder()
.setCustomId("queue") .setCustomId("queue")
.setEmoji("📑") .setEmoji("📑")
.setLabel("Queue")
.setStyle(ButtonStyle.Secondary) .setStyle(ButtonStyle.Secondary)
); );