Przeglądaj źródła

Limit description to <2048 characters

master
NGnius (Graham) 3 lat temu
rodzic
commit
f53f8381ee
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      src/gitea_command.rs

+ 6
- 1
src/gitea_command.rs Wyświetl plik

@@ -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)


Ładowanie…
Anuluj
Zapisz