House keeping
This commit is contained in:
@@ -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?;
|
||||
|
@@ -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?;
|
||||
|
@@ -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?;
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user