mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
fix: Small changes to new action buttons
This commit is contained in:
1 parent
5dfe902f9e
commit
981be707f0
5 files changed
+28
-31
No files matched your search
@@ -68,30 +68,27 @@ class QueueCommand extends BaseSlashCommandInteraction {
|
||||
logger.debug('Queue exists with current track, gathering information.');
|
||||
|
||||
const playPauseButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setCustomId(`nowplaying-playpause-button_${currentTrack.id}`)
|
||||
// .setLabel('Pause/Resume track')
|
||||
.setCustomId(`action-pauseresume-button_${currentTrack.id}`)
|
||||
.setLabel(queue.node.isPaused() ? 'Resume' : 'Pause')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.pauseResumeTrack)
|
||||
.toJSON();
|
||||
const components: APIMessageActionRowComponent[] = [playPauseButton];
|
||||
if (queue.history.tracks.data.length > 0) {
|
||||
const backButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setCustomId(`nowplaying-back-button_${currentTrack.id}`)
|
||||
// .setLabel('Previous track')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.previousTrack)
|
||||
.toJSON();
|
||||
components.unshift(backButton);
|
||||
}
|
||||
if (queue.tracks.data.length > 0) {
|
||||
const skipButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setCustomId(`nowplaying-skip-button_${currentTrack.id}`)
|
||||
// .setLabel('Skip track')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.nextTrack)
|
||||
.toJSON();
|
||||
components.push(skipButton);
|
||||
}
|
||||
const previousButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setDisabled(queue.history.tracks.data.length > 0 ? false : true)
|
||||
.setCustomId(`action-previous-button_${currentTrack.id}`)
|
||||
.setLabel('Previous')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.previousTrack)
|
||||
.toJSON();
|
||||
components.unshift(previousButton);
|
||||
const skipButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setCustomId(`action-skip-button_${currentTrack.id}`)
|
||||
.setLabel('Skip')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.nextTrack)
|
||||
.toJSON();
|
||||
components.push(skipButton);
|
||||
|
||||
const embedActionRow: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
type: ComponentType.ActionRow,
|
||||
|
||||
Reference in new issue
Block a user