diff --git a/src/web.rs b/src/web.rs index d2283bb..a55dcb6 100644 --- a/src/web.rs +++ b/src/web.rs @@ -179,10 +179,19 @@ async fn monzo_hook(hook: MonzoHook, state: State) -> anyhow::Result { + let new_bal = resp.balance; + let now_quid = new_bal / 100; + let now_pennies = new_bal % 100; + buf.push_str(&format!(" now £{}.{:02}", now_quid, now_pennies)); + } + Err(err) => { + buf.push_str(". Error when getting now."); + eprintln!("when querying balance after webhook: {:?}", err); + } + } + } let content = MessageEventContent::text_plain(&buf);