introduct macro to automatically reply with i18n message and return from command handler

This commit is contained in:
mykola2312 2024-03-03 18:54:26 +02:00
parent da0f33df6b
commit e692ebceb8

View file

@ -2,5 +2,14 @@ pub mod bot;
pub mod dl; pub mod dl;
pub mod op; pub mod op;
pub mod sanitize; pub mod sanitize;
pub mod request;
pub mod start; pub mod start;
pub mod types; 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(())
}
}