UNPKG

discord-webhook-library

Version:

A powerful and easy-to-use library for creating and sending richly formatted messages to Discord webhooks, with built-in validation and rate-limiting.

34 lines (33 loc) 1.24 kB
import { AxiosInstance } from 'axios'; /** * Delays the execution of the code for a specified number of seconds. * @param second - The number of seconds to delay. * @returns A Promise that resolves after the specified number of seconds. */ export declare function delay(second: number): Promise<void>; /** * Class for handling HTTP requests with customizable headers, body, and parameters. * * @class * @internal * @category Internal */ export declare class Request { private client; /** * The number of request attempts made. */ private retries; constructor(client: AxiosInstance); /** * Send the HTTP request. * * @param method - The HTTP method to use. Defaults to 'GET'. * @param data - The data to send with the request. * @param headers - Optional headers for the request. * @param url - Optional URL for the request. If not provided, axios baseURL will be used. * @returns A Promise that resolves with the response data, or rejects with an Error if an error occurs. * @throws {Error} if an error occurs. */ send(method?: 'GET' | 'POST' | 'PATCH' | 'DELETE', data?: unknown, headers?: Record<string, string>, url?: string): Promise<unknown>; }