websockets-topgg
Version:
A real-time WebSocket client for Top.gg that converts webhooks into a persistent connection, enabling seamless vote tracking, reminders, and enhanced community engagement.
19 lines (18 loc) • 543 B
TypeScript
export declare enum CustomErrorCodes {
GENERAL_ERROR = 0,
MALFORMED_REQUEST = 1,
INVALID_TOKEN = 2,
NO_TOKEN_PROVIDED = 3,
UNKNOWN_USER = 10001,
UNKNOWN_ENTITY = 10002,
UNKNOWN_USER_OR_ENTITY = 10003
}
export type APIRequestIssue = {
code: CustomErrorCodes;
reason: string;
};
export declare class ApiError extends Error {
code?: CustomErrorCodes | undefined;
constructor(message: string, code?: CustomErrorCodes | undefined);
}
export declare function throwApiError(res: Response): Promise<never>;