summaryrefslogtreecommitdiff
path: root/src/callbacks.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/callbacks.rs')
-rw-r--r--src/callbacks.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/callbacks.rs b/src/callbacks.rs
index 53ae07c..8b4e846 100644
--- a/src/callbacks.rs
+++ b/src/callbacks.rs
@@ -91,6 +91,34 @@ pub async fn handler(
}
}
},
+ "timetable" => unsafe {
+ match browser::select_table_row(call[2]).await {
+ Ok(result) => {
+ if result {
+ cx.requester
+ .edit_message_text(
+ chat_id.to_string(),
+ cx.update.message.clone().unwrap().id,
+ "Reservation made! ✅",
+ )
+ .await?;
+ return Ok(true);
+ } else {
+ cx.requester
+ .edit_message_text(
+ chat_id.to_string(),
+ cx.update.message.clone().unwrap().id,
+ "Error, try again! ⚠️",
+ )
+ .await?;
+ return Ok(false);
+ }
+ }
+ Err(_) => {
+ return Ok(false);
+ }
+ }
+ },
_ => Ok(false),
}
}