diff --git a/src/github.rs b/src/github.rs index e47dbaa..019dbbb 100644 --- a/src/github.rs +++ b/src/github.rs @@ -36,6 +36,7 @@ pub struct GithubLabel { pub struct GithubUser { pub id: usize, pub login: String, + pub r#type: String, } #[derive(Deserialize, Debug)] diff --git a/src/main.rs b/src/main.rs index 8e3bfa7..f0947cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -219,13 +219,16 @@ fn make_message(pull_request: GithubPullRequest, show_pr_age: bool) -> String { "".to_string() }; - let user = if pull_request.user.login.contains("[bot]") { - format!("🤖 {}", pull_request.user.login) + let user_emoji = if pull_request.user.r#type.to_lowercase() == "bot" { + "🤖".to_string() } else { - format!("👤 {}", pull_request.user.login) + "👤".to_string() }; - format!("{}{} \n\n{}\n", message, age_output, user) + format!( + "{}{} \n\n{} {}\n", + message, age_output, user_emoji, pull_request.user.login + ) } fn get_age(d1: DateTime, d2: DateTime) -> String {