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

Function get_all_guild_scripts

components/webapi/src/routes/scripts.rs:24–38  ·  view source on GitHub ↗
(
    Extension(current_guild): Extension<CurrentUserGuild>,
    State(state): State<AppState>,
)

Source from the content-addressed store, hash-verified

22};
23
24pub async fn get_all_guild_scripts(
25 Extension(current_guild): Extension<CurrentUserGuild>,
26 State(state): State<AppState>,
27) -> ApiResult<impl IntoResponse> {
28 let scripts = state
29 .db
30 .list_scripts(current_guild.id)
31 .await
32 .map_err(|err| {
33 error!(%err, "failed fetching guild scripts");
34 ApiErrorResponse::InternalError
35 })?;
36
37 Ok(Json(scripts))
38}
39
40#[derive(Serialize)]
41pub struct GetScriptsWithPluginsResponse {

Callers

nothing calls this directly

Calls 1

list_scriptsMethod · 0.80

Tested by

no test coverage detected