Hyper as a client

We'll take a look at Hyper via something practical. Telegram is a widely used public chat platform that has an open HTTP API for creating both clients and bots. We'll use that to build an example for Hyper's client side. The full Telegram Bot API is documented in https://core.telegram.org/bots/api in case you wish to build more extended bots. Also, be sure to take a peek at https://crates.io/ for premade crates that implement the API. We'll cover just a minimal subset of it here.

First of all, we'll need to request the Telegram network to give us a new bot and a token for it. The token both identifies the bot and authenticates our usage of it, so it should be considered a secret. This is done by logging in to the Telegram ...

Get Mastering Rust now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.