Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blockkwork/zgram
the best (as of 2024) zig framework for creating telegram bots
https://github.com/blockkwork/zgram
Last synced: about 2 months ago
JSON representation
the best (as of 2024) zig framework for creating telegram bots
- Host: GitHub
- URL: https://github.com/blockkwork/zgram
- Owner: blockkwork
- Created: 2024-08-13T20:22:11.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T20:26:44.000Z (5 months ago)
- Last Synced: 2024-08-13T23:24:01.352Z (5 months ago)
- Language: Zig
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zgram
## 💡 Info
In development. use at your own risk## 🚀 Example
full example: [src/main.zig](https://github.com/blockkwork/zgram/blob/main/src/main.zig)```zig
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();var tg = try Client.init(allocator, TOKEN, .{});
{
try tg.handleAll(handleKeyboard); // handle all messages
try tg.command("start", handleAll); // handle /start command
try tg.hears("hello from zgram!", handleAll); // handle message
try tg.action("data1", handleQuery); // handle callback query
}
try tg.startPolling(.{ .drop_pending_updates = true });
```![image](https://github.com/user-attachments/assets/fa302fab-4230-4298-883d-e2f8c77454ce)