create LeaveApplication callback
This commit is contained in:
parent
f1ecd0d1db
commit
aa32d73046
13
src/main.rs
13
src/main.rs
@ -83,6 +83,7 @@ pub enum Callback {
|
|||||||
MoreInfo,
|
MoreInfo,
|
||||||
ProjectPage { id: u32 },
|
ProjectPage { id: u32 },
|
||||||
GoHome,
|
GoHome,
|
||||||
|
LeaveApplication,
|
||||||
}
|
}
|
||||||
|
|
||||||
type CallbackStore = CallbackInfo<Callback>;
|
type CallbackStore = CallbackInfo<Callback>;
|
||||||
@ -364,6 +365,18 @@ async fn callback_handler(bot: Bot, mut db: DB, q: CallbackQuery) -> BotResult<(
|
|||||||
)
|
)
|
||||||
.await?
|
.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(())
|
Ok(())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user