diff --git a/rust_bot/Cargo.lock b/rust_bot/Cargo.lock index d8d907c..18b2061 100644 --- a/rust_bot/Cargo.lock +++ b/rust_bot/Cargo.lock @@ -45,6 +45,21 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -242,6 +257,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -823,6 +852,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -1443,6 +1495,7 @@ name = "rust_bot" version = "0.1.0" dependencies = [ "axum", + "chrono", "dotenv", "env_logger", "http 1.0.0", @@ -2430,6 +2483,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/rust_bot/src/assistant.rs b/rust_bot/src/assistant.rs index cf3cf8b..2be6457 100644 --- a/rust_bot/src/assistant.rs +++ b/rust_bot/src/assistant.rs @@ -839,7 +839,7 @@ pub async fn assistant_chat_handler_form( let user_id = &assistant_chat_form.user_id; let message = &assistant_chat_form.message; // log user_id and message - info!("User ID: {}, Message: {}", user_id, message); + info!("chat_id: {}, message: {}", user_id, message); // Initialize chat or get existing chat_id let chat_id = match db.get_chat_id(user_id).await? { Some(id) => id, @@ -854,6 +854,8 @@ pub async fn assistant_chat_handler_form( new_chat_id } }; + // log user_id and message + info!("chat_id: {}", chat_id); // Save the user's message to the database db.save_message_to_db(&chat_id.to_string(), "user", message) .await?;