create LeaveApplication callback

This commit is contained in:
Akulij 2025-05-02 17:19:44 +03:00
parent f1ecd0d1db
commit aa32d73046

View File

@ -83,6 +83,7 @@ pub enum Callback {
MoreInfo,
ProjectPage { id: u32 },
GoHome,
LeaveApplication,
}
type CallbackStore = CallbackInfo<Callback>;
@ -364,6 +365,18 @@ async fn callback_handler(bot: Bot, mut db: DB, q: CallbackQuery) -> BotResult<(
)
.await?
}
Callback::LeaveApplication => {
let application = Application::new(q.from.clone()).store(&mut db).await?;
send_application_to_chat(&bot, &mut db, &application).await?;
answer_message(
&bot,
q.from.id.0 as i64,
&mut db,
"left_application_msg",
None as Option<InlineKeyboardMarkup>,
)
.await?;
}
};
Ok(())