UNPKG

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.

40 lines 1.73 kB
import type { Snowflake, StarboardChannel, MessageSearchResult, MessageSearchService as IMessageSearchService } from '../types'; import { Logger } from '../utils/Logger'; /** * Service for searching starboard messages. * * IMPROVEMENT: Implements paginated search to overcome the 100-message limit. * The original code only searched the last 100 messages which caused issues * when the starboard channel grew beyond 100 messages. */ export declare class MessageSearchService implements IMessageSearchService { private readonly logger; constructor(logger: Logger); /** * Find an existing starboard message for a given original message. * * IMPROVEMENT: Uses pagination to search beyond 100 messages. * Also uses message ID in embed footer for reliable matching * instead of fragile URL string comparison. * * @param channel - The starboard channel to search in * @param originalMessageId - The ID of the original message * @param maxSearchDepth - Maximum number of messages to search (default: 500) */ findStarboardMessage(channel: StarboardChannel, originalMessageId: Snowflake, maxSearchDepth?: number): Promise<MessageSearchResult>; /** * Find message by ID stored in embed footer. * This is the preferred method as it's more reliable. */ private findByFooterId; /** * Find message by URL in embed field. * Fallback for backward compatibility with old starboard messages. */ private findByMessageUrl; /** * Delete a starboard message by its ID. */ deleteStarboardMessage(channel: StarboardChannel, messageId: Snowflake): Promise<boolean>; } //# sourceMappingURL=MessageSearchService.d.ts.map