354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
}
impl UpdateHandler for Core {
/// Dispatches an incoming Telegram update to a matching command handler and reports handler errors to the originating chat.
///
/// This method inspects the update; if it contains a message that can be parsed as a bot command,
/// it executes the corresponding command handler. If the handler returns an error, the error text
/// is sent back to the message's chat using MarkdownV2 formatting. Unknown commands produce an erro
/// which is also reported to the chat.
async fn handle (&self, update: Update) {
if let UpdateType::Message(msg) = update.update_type
&& let Ok(cmd) = Command::try_from(msg)
{
let msg = cmd.get_message();
let words = cmd.get_args();
|
|
|
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
}
impl UpdateHandler for Core {
/// Dispatches an incoming Telegram update to a matching command handler and reports handler errors to the originating chat.
///
/// This method inspects the update; if it contains a message that can be parsed as a bot command,
/// it executes the corresponding command handler. If the handler returns an error, the error text
/// is sent back to the message's chat using MarkdownV2 formatting. Unknown commands produce an error
/// which is also reported to the chat.
async fn handle (&self, update: Update) {
if let UpdateType::Message(msg) = update.update_type
&& let Ok(cmd) = Command::try_from(msg)
{
let msg = cmd.get_message();
let words = cmd.get_args();
|