change start buttons

This commit is contained in:
Akulij 2025-04-30 21:17:46 +03:00
parent 88417441ac
commit c56b3bf4eb

View File

@ -604,24 +604,7 @@ async fn answer_message<RM: Into<ReplyMarkup>>(
} }
async fn make_start_buttons(db: &mut DB) -> BotResult<InlineKeyboardMarkup> { async fn make_start_buttons(db: &mut DB) -> BotResult<InlineKeyboardMarkup> {
let mut buttons: Vec<Vec<InlineKeyboardButton>> = db let mut buttons: Vec<Vec<InlineKeyboardButton>> = Vec::new();
.get_all_events()
.await?
.iter()
.map(|e| {
vec![InlineKeyboardButton::callback(
e.time.with_timezone(&Asia::Dubai).to_string(),
format!("event:{}", e._id),
)]
})
.collect();
buttons.push(vec![InlineKeyboardButton::callback(
"More info",
CallbackStore::new(Callback::MoreInfo)
.store(db)
.await?
.get_id(),
)]);
buttons.push(vec![ buttons.push(vec![
create_callback_button( create_callback_button(
"show_projects", "show_projects",
@ -630,6 +613,13 @@ async fn make_start_buttons(db: &mut DB) -> BotResult<InlineKeyboardMarkup> {
) )
.await?, .await?,
]); ]);
buttons.push(vec![InlineKeyboardButton::callback(
"More info",
CallbackStore::new(Callback::MoreInfo)
.store(db)
.await?
.get_id(),
)]);
Ok(InlineKeyboardMarkup::new(buttons)) Ok(InlineKeyboardMarkup::new(buttons))
} }