Module telegram-bot-lua.adapters

adapter registry for database, Redis, LLM, and email adapters.

[[

Functions

api.adapters.create_socket() create a TCP socket that auto-selects sync or async mode.
api.adapters.http_request(url, opts) perform an HTTP request that auto-selects sync or async transport.
api.adapters.is_async() check if we're inside a copas async context.


Functions

api.adapters.create_socket()
create a TCP socket that auto-selects sync or async mode.

Returns:

    userdata a TCP socket, wrapped with copas if in async context
api.adapters.http_request(url, opts)
perform an HTTP request that auto-selects sync or async transport.

Parameters:

  • url string the request URL
  • opts table optional request options (method, headers, body)

Returns:

  1. string response body, or nil on error
  2. number HTTP status code or error message
api.adapters.is_async()
check if we're inside a copas async context.

Returns:

    boolean true if running inside copas
generated by LDoc 1.5.0 Last updated 2026-04-07 21:37:15