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

Function get_published_public_plugins

components/webapi/src/routes/plugins.rs:60–81  ·  view source on GitHub ↗

get all plugins (TODO: filtering)

(
    State(state): State<AppState>,
    Extension(maybe_session): Extension<OptionalSession>,
)

Source from the content-addressed store, hash-verified

58
59// get all plugins (TODO: filtering)
60pub async fn get_published_public_plugins(
61 State(state): State<AppState>,
62 Extension(maybe_session): Extension<OptionalSession>,
63) -> ApiResult<Json<Vec<PluginResponse>>> {
64 let plugins = state
65 .db
66 .get_published_public_plugins()
67 .await
68 .map_err(|err| {
69 error!(?err, "failed fetching plugins");
70 ApiErrorResponse::InternalError
71 })?;
72
73 let plugins = fetch_plugin_authors(
74 &state.discord_config,
75 maybe_session.as_ref().map(|v| &v.session.user),
76 &plugins,
77 )
78 .await?;
79
80 Ok(Json(plugins))
81}
82
83// get user plugins
84pub async fn get_user_plugins(

Callers

nothing calls this directly

Calls 2

fetch_plugin_authorsFunction · 0.85

Tested by

no test coverage detected