6 releases (breaking)

0.6.0 May 3, 2024
0.5.0 Nov 18, 2023
0.4.0 Oct 14, 2022
0.3.0 May 5, 2021
0.1.0 Jan 31, 2020

#256 in Web programming

Download history 6/week @ 2024-01-21 1/week @ 2024-01-28 9/week @ 2024-02-11 39/week @ 2024-02-18 54/week @ 2024-02-25 13/week @ 2024-03-03 43/week @ 2024-03-10 39/week @ 2024-03-17 19/week @ 2024-03-24 75/week @ 2024-03-31 141/week @ 2024-04-07 295/week @ 2024-04-14 46/week @ 2024-04-21 227/week @ 2024-04-28 50/week @ 2024-05-05

632 downloads per month
Used in 3 crates

MIT/Apache

1MB
14K SLoC

grammers-client

This library is a higher-level interface to interact with Telegram's API.

It contains the code necessary to create a client, connect to the API and make Remote Procedure Calls (RPC) to it, such as signing in or sending a message.

The library is in development, but new releases are only cut rarely. Specifying the dependency from the git repository is recommended:

grammers-client = { git = "https://github.com/Lonami/grammers" }

lib.rs:

This library is a high-level implementation to access Telegram's API, which essentially lets you automate everything you can do with official Telegram clients and more from Rust, or even control bot accounts, making it a viable alternative to using the Telegram Bot API.

In order to create an application with the library for people to use, you will need to obtain a developer API ID first. You can embed it as a constant in your binary and ship that to users (anyone can login, including yourself and bots, with the developer API ID; they do not need to provide their own API ID).

Once that's ready, connect a new Client and start making API calls.

When a method is said to be "expensive", this often means that calling it too much in a certain period of time will result in the API returning "flood wait" errors, meaning that the method cannot be called again for a certain amount of seconds (trying to do so will continue to return the flood wait error for that duration).

On the other hand, a "cheap" method can be called a lot and is unlikely to result in a flood wait error. However, all methods can potentially cause a flood wait, so some care is still required.

There is nothing wrong with causing the API to return flood wait errors, but it might be a good idea to try and not hit them.

A flood wait error is different from a peer flood error. A peer flood error means the flood limitation is applied account-wide, and its duration is undefined. This often means that the account spammed, or a young account tried to contact too many peers.

Dependencies

~7–18MB
~228K SLoC