House keeping

This commit is contained in:
2023-05-27 21:56:58 +03:00
parent cf28aba231
commit e5a0da9890
7 changed files with 100 additions and 55 deletions

View File

@@ -87,6 +87,7 @@ async fn get_account_name(
) -> crate::Result<()> {
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
if Account::exists(user_id, &name, &db).await? {
dialogue.exit().await?;
bot.send_message(msg.chat.id, "Account alreay exists")
.reply_markup(deletion_markup())
.await?;

View File

@@ -37,6 +37,7 @@ async fn get_account_name(
) -> crate::Result<()> {
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
if !Account::exists(user_id, &name, &db).await? {
dialogue.exit().await?;
bot.send_message(msg.chat.id, "Account doesn't exists")
.reply_markup(deletion_markup())
.await?;

View File

@@ -49,6 +49,7 @@ async fn get_account_name(
) -> crate::Result<()> {
let user_id = msg.from().ok_or(NoUserInfo)?.id.0;
if !Account::exists(user_id, &name, &db).await? {
dialogue.exit().await?;
bot.send_message(msg.chat.id, "Account doesn't exists")
.reply_markup(deletion_markup())
.await?;

View File

@@ -13,6 +13,7 @@ pub async fn account_markup(
.await?
.map_ok(KeyboardButton::new)
.try_chunks(3)
.map_err(|err| err.1)
.try_collect()
.await?;
let markup = KeyboardMarkup::new(account_names)