Godot-tdlib is a GDExtension C++ wrapper for working with TdLib (JSON interface) on Godot Engine. Can be used to create games or applications for integration or create alternative Telegram clients through Telegram Database API.
Features
TdJsonManager- global singleton for TDLib configuration, synchronous requests, logging, and polling.TdJsonClient- an individual TDLib client. Create one withTdJsonClient.create()orTdJsonManager.create_client(), send requests withsend(), and close it withclose_and_destroy().- Receive all updates through
TdJsonManager.request_received, or connect to a specific client'sresponse_receivedsignal. - Configure TDLib parameters, set a bot token, query the TDLib version, and control log verbosity.
- The extension requires Godot 4.5 or newer.
Usage
The wrapper can be used to integrate TDLib into a Godot game or application, including a Telegram client. See the example project for a working login flow.
Create a client, connect to the manager's response signal, and start the polling thread:
var client: TdJsonClient
func _ready() -> void:
client = TdJsonClient.create()
TdJsonManager.request_received.connect(_on_response_received)
TdJsonManager.start_poll()
func _on_response_received(response: Dictionary) -> void:
# Handle a TDLib update or the answer to a request.
print(response)
TdJsonManager.request_received emits every response received by the manager as one Dictionary; TdJsonClient.response_received emits responses for that client with its client ID and response dictionary. TdJsonManager.receive(timeout) is available for manual polling, but do not call it concurrently with start_poll().
Call TdJsonManager.set_tdlib_parameters(...) with your Telegram API credentials before polling; the manager sends them when TDLib requests initialization. Use client.send(...) to send TDLib JSON API requests after creating the client. The example project demonstrates both initialization and authentication.
Documentation
Basic documentation in xml format (available through the engine): https://github.com/Utilerain/godot-tdlib/tree/master/doc_classes. For complete documentation on Telegram API, you should refer to the official tdlib documentation: https://core.telegram.org/tdlib/docs/.
Supported platforms
| Platform | Architectures | Support |
|---|---|---|
| Windows | x86_64 | ✅ |
| Linux | x86_64 | ✅ |
| Android | arm64, arm32, x86_64, x86_32 | ✅ |
| macOS | — | ❌ |
| iOS | — | ❌ |
Changelog for version v1.2.2-1.8.70
2026-11-09 15:01:00
No changelog provided for this version.