25 lines
602 B
Rust
25 lines
602 B
Rust
use crate::prelude::*;
|
|
|
|
pub async fn delete(
|
|
bot: Throttle<Bot>,
|
|
msg: Message,
|
|
db: Pool,
|
|
locale: LocaleRef,
|
|
) -> crate::Result<()> {
|
|
let user_id = msg.from.as_ref().ok_or(NoUserInfo)?.id.0;
|
|
|
|
let markup = menu_markup("delete1", 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(())
|
|
}
|