diff --git a/README.md b/README.md index fc25720..407df9d 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,12 @@ ## Core Features 🌟 Cadence offers an enriching audio experience on Discord with features such as: -- High-quality music playback from [many supported sources](https://discord-player.js.org/guide/extractors/stream-sources) thanks to [discord-player](https://github.com/androz2091/discord-player) -- Implements latest Discord features such as slash commands, autocompleting search queries and more -- Open-source codebase and community based development, open to feedback and improvements -- No locked functionality, no premium tier, no ads; everything's free, always +- High-quality music playback from [many supported sources](https://discord-player.js.org/guide/extractors/stream-sources) thanks to [discord-player](https://github.com/androz2091/discord-player). +- Slash commands, autocompleting search queries, select menus, buttons and more interactive features! +- Full queue management system to add, remove, skip or move tracks, view queue and history. +- Audio filters, shuffle mode, repeat track, queue or autoplay similar tracks! +- Open-source codebase and community based development, open to feedback and improvements. +- No locked functionality, no premium tier, no ads; everything's free, always.
diff --git a/src/interactions/commands/info/help.ts b/src/interactions/commands/info/help.ts index 5495cce..35edf60 100644 --- a/src/interactions/commands/info/help.ts +++ b/src/interactions/commands/info/help.ts @@ -1,5 +1,11 @@ import { + APIActionRowComponent, + APIButtonComponent, + APIMessageActionRowComponent, + ButtonBuilder, + ButtonStyle, Collection, + ComponentType, EmbedBuilder, SlashCommandBuilder, SlashCommandNumberOption, @@ -22,11 +28,34 @@ class HelpCommand extends BaseSlashCommandInteraction { const logger = this.getLogger(this.name, executionId, interaction); const translator = useServerTranslator(interaction); - const [commandEmbedString, supportServerString, addBotString] = await Promise.all([ - this.getCommandEmbedString(client!), - this.getSupportServerString(translator), - this.getAddBotString(translator) - ]); + const commandEmbedString = await this.getCommandEmbedString(client!); + + const components: APIMessageActionRowComponent[] = []; + + if (this.botOptions.serverInviteUrl && this.botOptions.serverInviteUrl !== '') { + const supportServerButton: APIButtonComponent = new ButtonBuilder() + .setURL(this.botOptions.serverInviteUrl) + .setStyle(ButtonStyle.Link) + .setEmoji(this.embedOptions.icons.support) + .setLabel('Support server') + .toJSON(); + components.push(supportServerButton); + } + + if (this.botOptions.botInviteUrl && this.botOptions.botInviteUrl !== '') { + const addBotButton: APIButtonComponent = new ButtonBuilder() + .setURL(this.botOptions.botInviteUrl) + .setStyle(ButtonStyle.Link) + .setEmoji(this.embedOptions.icons.bot) + .setLabel('Add bot') + .toJSON(); + components.push(addBotButton); + } + + const embedActionRow: APIActionRowComponent = { + type: ComponentType.ActionRow, + components + }; logger.debug('Responding with info embed.'); return await interaction.editReply({ @@ -37,12 +66,11 @@ class HelpCommand extends BaseSlashCommandInteraction { icon: this.embedOptions.icons.rule }) + '\n' + - commandEmbedString + - supportServerString + - addBotString + commandEmbedString ) .setColor(this.embedOptions.colors.info) - ] + ], + components: components.length > 0 ? [embedActionRow] : [] }); } @@ -64,7 +92,7 @@ class HelpCommand extends BaseSlashCommandInteraction { return this.getCommandString(command); }); - const commandString = commandStringList.join('\n') + '\n'; + const commandString = commandStringList.join('\n'); return commandString; }