🤖 An elegant Telegram bots framework for Rust https://docs.rs/teloxide
Find a file
2019-10-15 16:50:24 +06:00
src Add some documentation 2019-10-15 13:50:28 +06:00
.gitignore Ignore .idea/ (.gitignore) 2019-09-02 00:23:03 +06:00
.travis.yml Run Travis CI on the nightly channel 2019-09-02 13:35:28 +06:00
Cargo.toml Merge pull request #20 from WaffleLapkin/dispatcher 2019-10-15 05:38:26 +00:00
ICON.png Improve the ICON.png quality 2019-10-15 16:16:56 +06:00
LICENSE Create LICENSE 2019-09-01 22:54:39 +06:00
README.md Add the 'An echo bot' section (README.md) 2019-10-15 16:50:24 +06:00
rustfmt.toml Set the line width to 80 (rustfmt.toml) 2019-09-04 20:07:56 +06:00

async-telegram-bot



A full-featured framework that empowers you to easily build Telegram bots using the async/.await syntax in Rust. It handles all the difficult stuff so you can focus only on your business logic.

An echo bot

async-telegram-bot (Rust)

const API_TOKEN: &str = "BOT TOKEN HERE";

fn main() { let bot = Bot::new(API_TOKEN).bla().bla(); }

aiogram (Python)

import logging
from aiogram import Bot, Dispatcher, executor, types

API_TOKEN = 'BOT TOKEN HERE'
logging.basicConfig(level=logging.INFO)
bot = Bot(token=API_TOKEN) dp = Dispatcher(bot)
@dp.message_handler(regexp='(^cat[s]?$|puss)') async def cats(message: types.Message): with open('data/cats.jpg', 'rb') as photo: await message.reply_photo (photo, caption='Cats are here 😺')
@dp.message_handler() async def echo(message: types.Message): await message.reply(message.text, reply=False)
executor.start_polling(dp, skip_updates=True)