Skip to main content

Module methods

Module methods 

Source
Expand description

This module contains all available methods to use the Bot API
To get started, you first have to create a bot

ⓘ
let bot = Bot::new("your_bot_api_key".to_json());

Afterwards you can use the bot, e.g.:

ⓘ
bot.get_me();

Structs§

Bot

Constants§

HTTP_TIMEOUT_SECS
HTTP timeout for every Bot API request. Must exceed LONG_POLL_TIMEOUT_SECS so an idle long poll ends as an empty ok response from Telegram, not as a client-side timeout.
LONG_POLL_TIMEOUT_SECS
Server-side long-poll window (seconds) used by Bot::start_polling. Telegram holds the getUpdates request open until an update arrives or this many seconds pass, so delivery stays instant while an idle bot makes one request per window instead of several per second.