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.
43 lines • 1.83 kB
TypeScript
import type { Client, Message, MessageReaction, User, Snowflake, StarboardOptions, StarboardChannel, ValidationService as IValidationService } from '../types';
import { Logger } from '../utils/Logger';
/**
* Service for validating reactions, messages, and permissions.
* Centralizes all validation logic following SRP.
*/
export declare class ValidationService implements IValidationService {
private readonly logger;
constructor(logger: Logger);
/**
* Check if a reaction should be processed for starboard.
*
* FIX: Corrected the logic bug from the original code.
* Original buggy code: `!user.bot || !this.options.ignoreBots` always returned true
* Fixed: Properly checks if bots should be ignored
*/
shouldProcessReaction(reaction: MessageReaction, user: User, options: StarboardOptions): boolean;
/**
* Check if a message is valid for starboard processing.
*/
isMessageValid(message: Message, options: StarboardOptions): boolean;
/**
* Get the count of valid reactions (excluding bots if configured).
*
* FIX: Corrected the filter logic from the original code.
* This always returned true because of incorrect boolean logic.
*/
getValidReactionCount(reaction: MessageReaction, options: StarboardOptions): Promise<number>;
/**
* Get the starboard channel for a guild.
* Validates that the channel exists and is a text-based channel.
*/
getStarboardChannel(guildId: Snowflake, options: StarboardOptions, client: Client): StarboardChannel | null;
/**
* Check if a channel is a text-based channel that can receive messages.
*/
private isTextChannel;
/**
* Check if a message is in an NSFW channel.
*/
private isNSFWChannel;
}
//# sourceMappingURL=ValidationService.d.ts.map