diff --git a/src/gitea_command.rs b/src/gitea_command.rs index bf9fe5a..712e578 100644 --- a/src/gitea_command.rs +++ b/src/gitea_command.rs @@ -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)