UNPKG

token-discord-checker

Version:

A comprehensive Discord token validation and verification tool

52 lines 1.77 kB
import { ApiValidationResponse, TokenCheckerConfig } from '../types/token.types'; /** * Discord API token validator * Validates tokens by making requests to Discord's API */ export declare class ApiValidator { private static readonly DEFAULT_TIMEOUT; private static readonly DEFAULT_USER_AGENT; /** * Validate token with Discord API * @param token - The Discord token to validate * @param config - Validation configuration * @returns API validation response */ static validateWithApi(token: string, config?: Partial<TokenCheckerConfig>): Promise<ApiValidationResponse>; /** * Make HTTP request to Discord API * @param token - The Discord token * @param config - Request configuration * @returns Discord user information */ private static makeApiRequest; /** * Parse Discord user information from API response * @param response - Raw API response * @returns Parsed user information */ private static parseUserInfo; /** * Test token with minimal API call * @param token - The Discord token to test * @param timeout - Request timeout in milliseconds * @returns Simple validation result */ static quickTest(token: string, timeout?: number): Promise<{ valid: boolean; error?: string; }>; /** * Check if error indicates rate limiting * @param error - The error to check * @returns True if error is rate limiting */ static isRateLimited(error: any): boolean; /** * Get retry delay from rate limit error * @param error - The rate limit error * @returns Retry delay in seconds */ static getRetryDelay(error: any): number; } //# sourceMappingURL=api-validator.d.ts.map