discord-starboard-plus
Version:
Discord Starboard Plus: A clean, maintainable starboard system for Discord.js bots. Features per-guild configuration, TypeScript support. Highlight your community's favorite messages with customizable starboards.
60 lines • 2.18 kB
TypeScript
import { ContainerBuilder, MessageFlags, type Message } from 'discord.js';
import type { StarboardOptions, StarboardEmbedResult, EmbedBuilderService as IEmbedBuilderService } from '../types';
/**
* Extended result type for Components V2
*/
export interface StarboardMessageData extends StarboardEmbedResult {
components?: ContainerBuilder[];
flags?: MessageFlags.IsComponentsV2;
}
/**
* Service for building starboard embeds.
* Supports both classic embeds and Discord Components V2.
*/
export declare class EmbedBuilderService implements IEmbedBuilderService {
/**
* Create a starboard embed for a message.
*
* - EmbedBuilder class instead of plain objects
* - displayAvatarURL with size option (not 'dynamic')
* - Proper GIF handling
* - Message ID in footer for reliable search
* - Optional Components V2 support
*/
createStarboardEmbed(message: Message, reactionCount: number, options: StarboardOptions): StarboardEmbedResult;
/**
* Create classic embed format (default)
*/
private createClassicEmbed;
/**
* Create Components V2 format (modern Discord UI)
* Uses containers, sections, and media galleries for a richer display.
*
* Components V2 patterns:
* - ContainerBuilder with accent color
* - TextDisplayBuilder for markdown content
* - SectionBuilder with thumbnail accessory
* - MediaGalleryBuilder for images
* - SeparatorBuilder for visual separation
* - MessageFlags.IsComponentsV2 required
*/
private createComponentsV2Message;
/**
* Update the reaction count in existing starboard message content.
*/
updateReactionCount(currentContent: string, newCount: number): string;
/**
* Process message attachments and add them to the embed.
* Handles images, GIFs, and videos appropriately.
*/
private processAttachments;
/**
* Categorize attachments into primary image and additional media.
*/
private categorizeAttachments;
/**
* Determine the type of an attachment.
*/
private getAttachmentType;
}
//# sourceMappingURL=EmbedBuilderService.d.ts.map