diff --git a/config/default.js b/config/default.js index 5dd15f8..954c0dd 100644 --- a/config/default.js +++ b/config/default.js @@ -65,6 +65,9 @@ module.exports.embedOptions = { info: '#5865F2', note: '#80848E' }, + components: { + showButtonLabels: false + }, icons: { logo: '🤖', beta: '`beta`', diff --git a/src/interactions/commands/player/filters.ts b/src/interactions/commands/player/filters.ts index cbf15c5..97f4278 100644 --- a/src/interactions/commands/player/filters.ts +++ b/src/interactions/commands/player/filters.ts @@ -194,11 +194,14 @@ class FiltersCommand extends BaseSlashCommandInteraction { const disableButton: APIButtonComponent = new ButtonBuilder() .setCustomId('filters-disable-button') - .setLabel('Disable all filters') .setStyle(ButtonStyle.Secondary) .setEmoji(this.embedOptions.icons.disable) .toJSON(); + if (this.embedOptions.components.showButtonLabels) { + disableButton.label = 'Disable all filters'; + } + const disableFiltersActionRow: APIActionRowComponent = { type: ComponentType.ActionRow, components: [disableButton] diff --git a/src/interactions/commands/player/history.ts b/src/interactions/commands/player/history.ts index ea127a0..8e71d2e 100644 --- a/src/interactions/commands/player/history.ts +++ b/src/interactions/commands/player/history.ts @@ -80,7 +80,6 @@ class HistoryCommand 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(); @@ -88,7 +87,6 @@ class HistoryCommand 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(); @@ -96,12 +94,17 @@ class HistoryCommand 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 = { type: ComponentType.ActionRow, components diff --git a/src/interactions/commands/player/nowplaying.ts b/src/interactions/commands/player/nowplaying.ts index c4f3117..8b7ab2a 100644 --- a/src/interactions/commands/player/nowplaying.ts +++ b/src/interactions/commands/player/nowplaying.ts @@ -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 = { type: ComponentType.ActionRow, components diff --git a/src/interactions/commands/player/queue.ts b/src/interactions/commands/player/queue.ts index ad47618..8cd1790 100644 --- a/src/interactions/commands/player/queue.ts +++ b/src/interactions/commands/player/queue.ts @@ -72,7 +72,6 @@ class QueueCommand 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(); @@ -80,7 +79,6 @@ class QueueCommand 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(); @@ -88,12 +86,17 @@ class QueueCommand 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 = { type: ComponentType.ActionRow, components diff --git a/src/types/configTypes.d.ts b/src/types/configTypes.d.ts index 538e8fe..df8a3e1 100644 --- a/src/types/configTypes.d.ts +++ b/src/types/configTypes.d.ts @@ -39,6 +39,9 @@ export type EmbedOptions = { info: ColorResolvable; note: ColorResolvable; }; + components: { + showButtonLabels: boolean; + }; icons: { logo: string; beta: string;