fix(gazebot): use as_str to actually get the noteid value

This commit is contained in:
dusk 2024-11-02 18:28:59 +03:00
parent 2dc5e6f1a5
commit a73fe75141
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -52,7 +52,7 @@ impl EventHandler for Handler {
}; };
let note_resp = resp.json::<serenity::json::JsonMap>().await.unwrap(); let note_resp = resp.json::<serenity::json::JsonMap>().await.unwrap();
let created_note_id = note_resp["noteId"].to_string(); let created_note_id = note_resp["noteId"].as_str().expect("note id must be a string");
tracing::info!("succesfully created note with id {created_note_id}"); tracing::info!("succesfully created note with id {created_note_id}");
let _ = msg.reply(ctx, format!("created log at https://gaze.systems/log?id={created_note_id}")).await; let _ = msg.reply(ctx, format!("created log at https://gaze.systems/log?id={created_note_id}")).await;