|
|
@@ -34,11 +34,16 @@ pub fn gitea_release(interaction: &Interaction) -> InteractionResponse { |
|
|
|
asset_str += &format!("[{}]({})\n", f.name, f.browser_download_url); |
|
|
|
} |
|
|
|
} |
|
|
|
// limit description to 2000 characters |
|
|
|
let mut desc = release.body.clone(); |
|
|
|
if desc.len() > 2000 { |
|
|
|
desc = desc[..2000].to_string() + "..."; |
|
|
|
} |
|
|
|
// assemble embed |
|
|
|
let embed = Embed { |
|
|
|
title: Some(format!("{} {}", &repo_name, &release.tag_name)), |
|
|
|
type_: None, |
|
|
|
description: Some(release.body.clone()), |
|
|
|
description: Some(desc), |
|
|
|
url: None, |
|
|
|
timestamp: None, |
|
|
|
color: Some(0x00C800), // Colour::from_rgb(0, 200, 0) |
|
|
|