telegram-bot-api-lightweight-client
Version:
Lightweight Telegram Bot API client. Exports only minimal Fetch call. Fully compatible with AWS LLRT.
32 lines (31 loc) • 1.22 kB
TypeScript
/**
* @internal
* Fetches data from the Telegram Bot API.
*
* @param path - The API endpoint to fetch data from, e.g., 'getMe'.
* @param args - The input arguments for the API call, which will be sent as JSON in the request body.
*
* @returns A promise that resolves to the output data from the API call, parsed as JSON.
*/
export declare let client_fetch: <In, Out>(path: string, args: In) => Promise<Out>;
/**
* Sets the Telegram Bot API token for the client.
* This is required to authenticate requests to the Telegram Bot API.
*
* @param token - The bot token provided by Telegram.
*/
export declare const client_setClientToken: (token: string) => void;
/**
* Sets the base URL for the client.
* This is useful if you want to use a different Telegram Bot API server or a mock server.
*
* @param url - The base URL to use for the client.
*/
export declare const client_setBaseUrl: (url: string) => void;
/**
* Sets a custom fetch function to be used by the client.
* This can be useful for testing or when you want to use a different HTTP client.
*
* @param customFetch - The custom fetch function to use.
*/
export declare const client_setFetch: (customFetch: typeof client_fetch) => void;