From f99490d3b86f7ee026f1f249c039d60e84128471 Mon Sep 17 00:00:00 2001 From: mykola2312 Date: Sun, 3 Mar 2024 18:54:26 +0200 Subject: [PATCH] introduct macro to automatically reply with i18n message and return from command handler --- src/bot.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bot.rs b/src/bot.rs index b1d6c64..53d7c23 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -2,5 +2,14 @@ pub mod bot; pub mod dl; pub mod op; pub mod sanitize; +pub mod request; pub mod start; pub mod types; + +#[macro_export] +macro_rules! reply_i18n_and_return { + ($bot:expr, $chat_id:expr, $line:expr) => { + $bot.send_message($chat_id, t!($line)).await?; + return Ok(()) + } +} \ No newline at end of file