diff --git a/src/gitea_command.rs b/src/gitea_command.rs index 7a79345..3746d46 100644 --- a/src/gitea_command.rs +++ b/src/gitea_command.rs @@ -123,8 +123,15 @@ pub fn gitea_issue(interaction: &Interaction) -> InteractionResponse { if desc.len() > 2000 { desc = desc[..2000].to_string() + "..."; } + // build tags field + let mut tags = Vec::new(); + for t in resp.labels { + tags.push(format!("{}", &t.name)); + } + let tag_str = tags.join(", "); + // build embed let embed = Embed { - title: Some(format!("{} #{}", &repo_name, index)), + title: Some(format!("Issue #{}", index)), type_: None, description: Some(desc), url: None, @@ -141,18 +148,23 @@ pub fn gitea_issue(interaction: &Interaction) -> InteractionResponse { provider: None, author: Some(EmbedAuthor { name: Some(resp.title.clone()), - url: Some(format!("https://git.exmods.org/{}/{}/issues/{}", &username, &repo_name, index)), + url: Some(resp.html_url), icon_url: None, proxy_icon_url: None }), - fields: None, - /*fields: Some(vec![ + //fields: None, + fields: Some(vec![ EmbedField { - name: "Download".to_string(), - value: asset_str, + name: "Labels".to_string(), + value: tag_str, inline: Some(true) - } - ])*/ + }, + EmbedField { + name: "Repository".to_string(), + value: format!("[{}](https://git.exmods.org/{}/{})", resp.repository.name, &username, &repo_name), + inline: Some(true) + }, + ]) }; return InteractionResponse::ChannelMessageWithSource { data: Some(InteractionApplicationCommandCallbackData {