Conogram: async Telegram Bot API client written in Rust

Aims

Features

TODO

Logging

How to enable logging in your executable

Quick usage overview

Using Local Bot API Server

```rust, norun let serverconfig = ApiServerConfig::local("http://localhost", 80, true);

let api_config = APIConfig::new("BOT_TOKEN", server_config)?

let api = API::new(api_config);

```

Setting default parse_mode

```rust, no_run let mut api = API::new(/**/);

// Setting parse_mode for sendMessage request
api.set_default_request_param(SendMessageRequest::get_name(), "parse_mode", "html")?;

// For all applicable requests
api.set_parse_mode("html")?;

```

Calling API methods

```rust, no_run let mut api = API::new(/**/);

// Required request parameters are in the request constructor, optionals are set via builder-like methods
// ChatId can be username of a channel
let request = api.send_message("@channelusername","Text").reply_to_message_id(42);

// All requests implement IntoFuture
let message = request.await?;

// You can handle some common API errors automatically
let message = API::request(request).await?;

```

Mutating and calling requests by references

```rust, norun
let mut request = api.send
message(chatid, "Text"); for i in 0..5 { request = request.chatid(i);

    // &Request implements IntoFuture too
    let message = (&request).await?;
}

```

FAQ

Q: Is it production-ready?
A: It may be, or may be not. The library is not thoroughly tested, some stuff may be broken.

Q: Are there any bots made with it?
A: I developed this library to be used by @hintorbot, so at least this one. If you want to list your bot here, contact me in tg: @encrypted_for