Added messages about no accounts found for get_account and delete commands
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user