UNPKG

scathach-api

Version:

A NodeJS wrapper to interacts with Scathach bot

25 lines (24 loc) 902 B
import phin from 'phin'; declare const delay = 1000; /** * GET request to scathach bot API * @param url The related endpoint * @param headers custom headers that you pass to the request * @returns Promise that resolves to the response body */ export declare function get(url: string, headers: string): Promise<phin.IJSONResponse<unknown>>; /** * Shuffles array in place. * @param arr An array containing the items. * @param path callback path * @returns shuffled array */ export declare function randomArray(arr: string, path?: string): string; /** * Rate limit handling for shit users which spamming the API * @param time The time in milliseconds * @param data The data that represents from get() * @returns resolved the requests */ export declare function ratelimit(time: number, data: string): Promise<unknown>; export { delay };