From aaed6fcdca8e9a06b68b223aac6bbe07f652a17f Mon Sep 17 00:00:00 2001 From: Akulij Date: Fri, 9 May 2025 00:25:30 +0300 Subject: [PATCH] store MessageForward in LeaveApplication callback --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 79af0fa..db806fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -439,8 +439,9 @@ async fn callback_handler(bot: Bot, mut db: DB, q: CallbackQuery) -> BotResult<( } Callback::LeaveApplication => { let application = Application::new(q.from.clone()).store(&mut db).await?; - send_application_to_chat(&bot, &mut db, &application).await?; - answer_message( + let msg = send_application_to_chat(&bot, &mut db, &application).await?; + + let (chat_id, msg_id) = answer_message( &bot, q.from.id.0 as i64, &mut db, @@ -448,6 +449,9 @@ async fn callback_handler(bot: Bot, mut db: DB, q: CallbackQuery) -> BotResult<( None as Option, ) .await?; + MessageForward::new(msg.chat.id.0, msg.id.0, chat_id, msg_id, false) + .store(&mut db) + .await?; } Callback::AskQuestion => { answer_message(