telegram-client
Telegram client for rust.
This crate use td to call telegram client api. support async api.
Usage
[]
= "1.7.*"
version
td and rtdlib/telegram-client
Version mapping
telegram-client | td |
---|---|
0.* | master |
1.3.* | 1.3.* |
1.4.* | 1.4.* |
1.5.* | 1.5.* |
1.6.* | 1.6.* |
1.7.* | 1.7.* |
telegram-client and rtdlib
A fixed version is recommended, you can read Comparison requirements about the fixed version. Because of cargo's dependency mechanism, if you don't specify a specific version, it will be automatically upgraded, but there is usually a dependency between t and a, and the new version cannot be applied. The current dependencies are as follows:
telegram-client | rtdlib |
---|---|
=1.3.7 | =1.3.7 |
=1.4.6 | =1.4.6 |
=1.5.5 | =1.5.5 |
=1.6.6 | =1.6.6 |
=1.7.0 | =1.7.0 |
=1.7.1 | =1.7.1 |
Note
Note that you need tdjson dylib file in your path for building and running your application. See also rtdlib-sys for more details.
Examples
block
async
async
more
more examples
Event
Most of the events are from td, two events of particular concern.
on_receive
This event is receive everything from td, returned data type is a json string.
on_exception
When td returned json can not deserialize, or your event handler returned error. will be call is event.
a sample of event handler returned error
listener.on_proxy;