MCPcopy Create free account
hub / github.com/Botloader/botloader / handle_get_connected_guilds

Function handle_get_connected_guilds

components/discordbroker/src/http_api.rs:307–322  ·  view source on GitHub ↗
(
    State(state): State<RouterState>,
)

Source from the content-addressed store, hash-verified

305}
306
307async fn handle_get_connected_guilds(
308 State(state): State<RouterState>,
309) -> Json<ConnectedGuildsResponse> {
310 if !state.ready_tracker.load(Ordering::SeqCst) {
311 return Json(ConnectedGuildsResponse::NotReady);
312 }
313
314 let guilds = state
315 .discord_state
316 .iter()
317 .guilds()
318 .map(|v| v.id())
319 .collect::<Vec<_>>();
320
321 Json(ConnectedGuildsResponse::Ready(guilds))
322}
323
324#[derive(Debug, Deserialize)]
325struct GetGuildMembersQuery {

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected