O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required