gotdbot is a powerful, pure Go wrapper for TDLib (Telegram Database Library). It provides a simple and idiomatic way to build Telegram clients and bots using Go.
Current Version: v0.5.0 and TDLib v1.8.61.
- Pure Go: No CGO mess in your application code (uses
puregoto loadlibtdjson). - High Performance: Direct binding to TDLib's JSON interface.
- Dispatcher System: Built-in update dispatcher with middleware-style handlers.
- Filters: Powerful and composable filters for message matching.
- Type-Safe: Fully generated Go structs for all TDLib types and methods.
- Context Aware: Easy access to effective messages, chats, and users.
-
Go: version 1.22 or newer
-
TDLib: the compiled
libtdjsonshared library-
Follow the official TDLib build instructions
-
Make sure the library is accessible on your system:
libtdjson.so(Linux)libtdjson.dylib(macOS)tdjson.dll(Windows)
-
Alternative: run
go run github.com/AshokShau/gotdbot/scripts/tools@latest
to automatically download the latest precompiled TDLib binaries.
-
go get github.com/AshokShau/gotdbotSample bots can be found in the examples directory.
- Echo Bot: A simple bot that echoes text messages.
- User Bot: Example of running a user account automation.
Contributions are welcome! Please open issues for bugs or feature requests.
This project is licensed under the MIT License.