Skip to content

Commit

Permalink
Merge pull request #18 from diwash007/links
Browse files Browse the repository at this point in the history
Fix: link on /hero
  • Loading branch information
washbin authored Oct 18, 2022
2 parents 60cebae + 8718d7c commit 28b045f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/hero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct Hero {

#[derive(Serialize, Deserialize, Clone)]
pub struct Pulls {
pub url: String,
pub html_url: String,
pub title: String,
}

Expand Down
12 changes: 7 additions & 5 deletions src/commands/hero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn run(
for _ in 0..3 {
hero.pulls.push(Pulls {
title: "".to_string(),
url: "".to_string(),
html_url: "".to_string(),
})
}
}
Expand All @@ -70,8 +70,10 @@ pub async fn run(

if hero.pulls[0..2].len() == index {
if !hero.pulls[index].title.is_empty() {
pull_req_cloned +=
&format!("<:reply:1029065416905076808>[{}]({})\n", pr.title, pr.url);
pull_req_cloned += &format!(
"<:reply:1029065416905076808>[{}]({})\n",
pr.title, pr.html_url
);
} else {
pull_req_cloned += "<:reply:1029065416905076808>Not Available\n";
}
Expand All @@ -80,7 +82,7 @@ pub async fn run(
} else {
pull_req_cloned += &format!(
"<:reply_multi:1029067132572549142>[{}]({})\n",
pr.title, pr.url
pr.title, pr.html_url
);
}

Expand Down Expand Up @@ -123,7 +125,7 @@ pub async fn run(
c.create_action_row(|r| {
r.add_button(link_button(
"Hero Page",
format!("https://github.com/{}", hero.github),
format!("https://novu.co/contributors/{}", hero.github),
"🔗".parse().unwrap(),
))
})
Expand Down

0 comments on commit 28b045f

Please sign in to comment.