mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
Merge branch 'main' into main
This commit is contained in:
2 files changed
+44
-14
No files matched your search
@@ -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.
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
@@ -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<APIMessageActionRowComponent> = {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user