|
@@ -74,6 +74,9 @@ enum Command {
|
|
|
|
|
|
|
|
#[command(description = "Cancel processing of current file")]
|
|
#[command(description = "Cancel processing of current file")]
|
|
|
Cancel,
|
|
Cancel,
|
|
|
|
|
+
|
|
|
|
|
+ #[command(description = "Create new account")]
|
|
|
|
|
+ NewAccount { account: String },
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async fn command_handler(
|
|
async fn command_handler(
|
|
@@ -106,6 +109,12 @@ async fn command_handler(
|
|
|
bot.send_message(msg.chat.id, "Dialogue state reset".to_string())
|
|
bot.send_message(msg.chat.id, "Dialogue state reset".to_string())
|
|
|
.await?
|
|
.await?
|
|
|
}
|
|
}
|
|
|
|
|
+ Command::NewAccount { account } => {
|
|
|
|
|
+ let mut user = User::new(msg.chat.id.0, &None);
|
|
|
|
|
+ user.new_account(account);
|
|
|
|
|
+ bot.send_message(msg.chat.id, "Account added".to_string())
|
|
|
|
|
+ .await?
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
Ok(())
|
|
Ok(())
|