Files
pass_manager/src/commands/menu.rs
2024-08-17 18:35:50 +03:00

25 lines
573 B
Rust

use crate::prelude::*;
pub async fn menu(
bot: Throttle<Bot>,
msg: Message,
db: Pool,
locale: LocaleRef,
) -> crate::Result<()> {
let user_id = msg.get_user_id()?;
let markup = menu_markup("get", user_id, &db).await?;
if markup.inline_keyboard.is_empty() {
bot.send_message(msg.chat.id, &locale.no_accounts_found)
.reply_markup(deletion_markup(locale))
.await?;
return Ok(());
}
bot.send_message(msg.chat.id, &locale.choose_account)
.reply_markup(markup)
.await?;
Ok(())
}