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:
- string response body, or nil on error
- 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