Skip to content

Commit

Permalink
Use username in added
Browse files Browse the repository at this point in the history
If available
  • Loading branch information
will-lynas committed Oct 14, 2024
1 parent 1dd7c1d commit e1aa07a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ async fn receive_title(
let chat_id = msg.chat.id.0;
let user = msg.from.unwrap();
let user_id = user.id.0 as i64;
let name = user.username.unwrap_or(user_id.to_string());

let transaction = Transaction {
user_id,
Expand All @@ -205,7 +206,7 @@ async fn receive_title(
"*Added transaction*\n\n 🏷️ {}\n 💰 {}\n 🥷 {}",
title,
markdown::escape(&format_pounds(amount)),
user.first_name
markdown::escape(&name)
),
)
.parse_mode(MarkdownV2)
Expand Down

0 comments on commit e1aa07a

Please sign in to comment.