[][src]Module my_iot::services::telegram

Telegram bot service able to receive and send messages.

Structs

Context
Settings
TelegramChat

https://core.telegram.org/bots/api#chat

TelegramMessage

https://core.telegram.org/bots/api#message

TelegramResponse

https://core.telegram.org/bots/api#making-requests

TelegramUpdate

Enums

TelegramChatId
TelegramFile

Constants

GET_UPDATES_TIMEOUT

Should be positive, short polling should be used for testing purposes only.

_IMPL_DESERIALIZE_FOR_Settings
_IMPL_DESERIALIZE_FOR_TelegramChat
_IMPL_DESERIALIZE_FOR_TelegramMessage
_IMPL_DESERIALIZE_FOR_TelegramResponse
_IMPL_DESERIALIZE_FOR_TelegramUpdate
_IMPL_SERIALIZE_FOR_TelegramChatId
_IMPL_SERIALIZE_FOR_TelegramFile

Statics

CLIENT_TIMEOUT

Global client timeout. Based on GET_UPDATES_TIMEOUT because reqwest does not allow to set individual reqwest timeout.

Functions

call_api

Call Telegram Bot API method.

get_updates

https://core.telegram.org/bots/api#getupdates

send_animation

https://core.telegram.org/bots/api#sendanimation

send_message

https://core.telegram.org/bots/api#sendmessage

send_photo

https://core.telegram.org/bots/api#sendphoto

send_readings

Send reading messages from the provided Telegram update.

spawn

Spawn the service.

spawn_consumer

Spawn thread that listens for Control messages and communicates back to Telegram.

spawn_producer

Spawn thread that listens for Telegram updates and produces reading messages.