diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2024-08-03 00:13:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-03 00:13:03 +0200 |
commit | 1ac4198ec988ac49cb7740336df7a43bab3fbe52 (patch) | |
tree | 3ae119f2ac4374a643ab2ebafd8fc9b584b7a2c1 /src-tauri/src | |
parent | 878f50ccd042f6768646131f29323d25c5142519 (diff) | |
download | FlightCore-1ac4198ec988ac49cb7740336df7a43bab3fbe52.tar.gz FlightCore-1ac4198ec988ac49cb7740336df7a43bab3fbe52.zip |
feat: Pick random adjective when generating release notes (#995)
from a list of predefined ones
Diffstat (limited to 'src-tauri/src')
-rw-r--r-- | src-tauri/src/github/release_notes.rs | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src-tauri/src/github/release_notes.rs b/src-tauri/src/github/release_notes.rs index e3a14537..4adfb24b 100644 --- a/src-tauri/src/github/release_notes.rs +++ b/src-tauri/src/github/release_notes.rs @@ -1,3 +1,4 @@ +use rand::prelude::SliceRandom; use serde::{Deserialize, Serialize}; use std::vec::Vec; use ts_rs::TS; @@ -168,9 +169,51 @@ pub async fn generate_release_note_announcement() -> Result<String, String> { let modders_info = "Mod compatibility should not be impacted"; let server_hosters_info = "REPLACE ME"; + let mut rng = rand::thread_rng(); + let attributes = vec![ + "adorable", + "amazing", + "beautiful", + "blithsome", + "brilliant", + "compassionate", + "dazzling", + "delightful", + "distinguished", + "elegant", + "enigmatic", + "enthusiastic", + "fashionable", + "fortuitous", + "friendly", + "generous", + "gleeful", + "gorgeous", + "handsome", + "lively", + "lovely", + "lucky", + "lustrous", + "marvelous", + "merry", + "mirthful", + "phantasmagorical", + "pretty", + "propitious", + "ravishing", + "sincere", + "sophisticated fellow", + "stupendous", + "vivacious", + "wonderful", + "zestful", + ]; + + let selected_attribute = attributes.choose(&mut rng).unwrap(); + // Build announcement string let return_string = format!( - r"Hello beautiful people <3 + r"Hello {selected_attribute} people <3 **Northstar `{current_ns_version}` is out!** {general_info} |