telega/update
Types
pub type Command {
Command(text: String, command: String, payload: Option(String))
}
Constructors
-
Command(text: String, command: String, payload: Option(String))
Represents a command message.
Arguments
- text
-
Whole command message
- command
-
Command name without the leading slash
- payload
-
The command arguments, if any.
Messages represent the data that the bot receives from the Telegram API.
pub type Update {
TextUpdate(
from_id: Int,
chat_id: Int,
text: String,
message: Message,
raw: ModelUpdate,
)
CommandUpdate(
from_id: Int,
chat_id: Int,
command: Command,
message: Message,
raw: ModelUpdate,
)
CallbackQueryUpdate(
from_id: Int,
chat_id: Int,
query: CallbackQuery,
raw: ModelUpdate,
)
}
Constructors
-
TextUpdate( from_id: Int, chat_id: Int, text: String, message: Message, raw: ModelUpdate, )
-
CommandUpdate( from_id: Int, chat_id: Int, command: Command, message: Message, raw: ModelUpdate, )
-
CallbackQueryUpdate( from_id: Int, chat_id: Int, query: CallbackQuery, raw: ModelUpdate, )