mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 22:15:29 +00:00
feat: Add new config option to enable/disable button labels
This commit is contained in:
1 parent
82927c5880
commit
47d3c36cc7
6 files changed
+28
-10
No files matched your search
@@ -49,7 +49,6 @@ class NowPlayingCommand extends BaseSlashCommandInteraction {
|
||||
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();
|
||||
@@ -57,7 +56,6 @@ class NowPlayingCommand extends BaseSlashCommandInteraction {
|
||||
|
||||
const playPauseButton: APIButtonComponent = new ButtonBuilder()
|
||||
.setCustomId(`action-pauseresume-button_${currentTrack.id}`)
|
||||
.setLabel(queue.node.isPaused() ? 'Resume' : 'Pause')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setEmoji(this.embedOptions.icons.pauseResumeTrack)
|
||||
.toJSON();
|
||||
@@ -65,12 +63,17 @@ class NowPlayingCommand extends BaseSlashCommandInteraction {
|
||||
|
||||
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);
|
||||
|
||||
if (this.embedOptions.components.showButtonLabels) {
|
||||
previousButton.label = 'Previous';
|
||||
playPauseButton.label = queue.node.isPaused() ? 'Resume' : 'Pause';
|
||||
skipButton.label = 'Skip';
|
||||
}
|
||||
|
||||
const embedActionRow: APIActionRowComponent<APIMessageActionRowComponent> = {
|
||||
type: ComponentType.ActionRow,
|
||||
components
|
||||
|
||||
Reference in new issue
Block a user