MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fetch_country_flags

Function fetch_country_flags

src/cloud.rs:80–89  ·  view source on GitHub ↗

Fetches country flags from the worldwide counter. Returns a list of emoji flags, or an empty vec on failure.

()

Source from the content-addressed store, hash-verified

78/// Fetches country flags from the worldwide counter.
79/// Returns a list of emoji flags, or an empty vec on failure.
80pub fn fetch_country_flags() -> Vec<String> {
81 let agent = agent_with_timeout(Duration::from_millis(500));
82 let Ok(mut resp) = agent.get(&format!("{WORKER_URL}/countries")).call() else {
83 return Vec::new();
84 };
85 let Ok(parsed): Result<CountriesResponse, _> = resp.body_mut().read_json() else {
86 return Vec::new();
87 };
88 parsed.flags
89}
90
91/// Response from GitHub releases API (only the fields we need).
92#[derive(serde::Deserialize)]

Callers 1

handle_status_commandFunction · 0.85

Calls 2

agent_with_timeoutFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected