diff --git a/src/commands/delete.rs b/src/commands/delete.rs index 0267b36..03e450e 100644 --- a/src/commands/delete.rs +++ b/src/commands/delete.rs @@ -54,8 +54,14 @@ pub async fn delete( ) -> crate::Result<()> { let user_id = msg.from().ok_or(NoUserInfo)?.id.0; let markup = markups::account_markup(user_id, &db).await?; + if markup.keyboard.is_empty() { + bot.send_message(msg.chat.id, "No accounts found") + .reply_markup(deletion_markup()) + .await?; + return Ok(()); + } let previous = bot - .send_message(msg.chat.id, "Send account name") + .send_message(msg.chat.id, "Send the name of the account to delete") .reply_markup(markup) .await?; dialogue diff --git a/src/commands/get_account.rs b/src/commands/get_account.rs index 01c8218..d5427e1 100644 --- a/src/commands/get_account.rs +++ b/src/commands/get_account.rs @@ -69,8 +69,14 @@ pub async fn get_account( ) -> crate::Result<()> { let user_id = msg.from().ok_or(NoUserInfo)?.id.0; let markup = markups::account_markup(user_id, &db).await?; + if markup.keyboard.is_empty() { + bot.send_message(msg.chat.id, "No accounts found") + .reply_markup(deletion_markup()) + .await?; + return Ok(()); + } let previous = bot - .send_message(msg.chat.id, "Send account name") + .send_message(msg.chat.id, "Send the name of the account to get") .reply_markup(markup) .await?; dialogue