Telegram icon
To automate your workflows, you need to sign an account first. It’s free.

Telegram Integration for

Quick Start

There is a echo bot, but plain text:

use tg_flows::{listen_to_update, update_handler, Telegram, UpdateKind};

#[tokio::main(flavor = "current_thread")]
pub async fn on_deploy() {
    let telegram_token = std::env::var("telegram_token").unwrap();

async fn handler(update: tg_flows::Update) {
    let telegram_token = std::env::var("telegram_token").unwrap();
    let tele = Telegram::new(telegram_token);

    if let UpdateKind::Message(msg) = update.kind {
        let text = msg.text().unwrap_or("");
        let chat_id =;
        let _sended_msg = tele.send_message(chat_id, text);

Telegram::new() is a Telegram constructor that represents a bot.

listen_to_update() is responsible for registering a listener for the bot represented by the telegram_token. When a new Update coming, the handler fn decorated by update_handler is called.

The whole document is here.