mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
fix: Extract logic for getting author value for embeds
This commit is contained in:
1 parent
8c05499f08
commit
83e23d87b4
60 files changed
+126
-317
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import config from 'config';
|
||||
import { GuildQueue } from 'discord-player';
|
||||
import {
|
||||
ApplicationCommandOptionChoiceData,
|
||||
AutocompleteInteraction,
|
||||
@@ -64,7 +65,7 @@ abstract class BaseInteractionWithEmbedResponse extends BaseInteraction {
|
||||
this.botOptions = config.get('botOptions');
|
||||
}
|
||||
|
||||
protected async getEmbedAuthor(
|
||||
protected async getEmbedUserAuthor(
|
||||
interaction: MessageComponentInteraction | ChatInputCommandInteraction
|
||||
): Promise<EmbedAuthorOptions> {
|
||||
let authorName: string = '';
|
||||
@@ -79,6 +80,16 @@ abstract class BaseInteractionWithEmbedResponse extends BaseInteraction {
|
||||
iconURL: interaction.user.avatarURL() || this.embedOptions.info.fallbackIconUrl
|
||||
};
|
||||
}
|
||||
|
||||
protected async getEmbedQueueAuthor(
|
||||
interaction: MessageComponentInteraction | ChatInputCommandInteraction,
|
||||
queue: GuildQueue
|
||||
): Promise<EmbedAuthorOptions> {
|
||||
return {
|
||||
name: `Channel: ${queue.channel!.name} (${queue.channel!.bitrate / 1000}kbps)`,
|
||||
iconURL: interaction.guild!.iconURL() || this.embedOptions.info.fallbackIconUrl
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class BaseSlashCommandInteraction extends BaseInteractionWithEmbedResponse {
|
||||
|
||||
Reference in new issue
Block a user