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

Function get_user_plugins

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

get user plugins

(
    State(state): State<AppState>,
    Extension(session): Extension<LoggedInSession>,
)

Source from the content-addressed store, hash-verified

82
83// get user plugins
84pub async fn get_user_plugins(
85 State(state): State<AppState>,
86 Extension(session): Extension<LoggedInSession>,
87) -> ApiResult<impl IntoResponse> {
88 let plugins = state
89 .db
90 .get_user_plugins(session.session.user.id.get())
91 .await
92 .map_err(|err| {
93 error!(?err, "failed fetching plugins");
94 ApiErrorResponse::InternalError
95 })?;
96
97 let plugins =
98 fetch_plugin_authors(&state.discord_config, Some(&session.session.user), &plugins).await?;
99
100 Ok(Json(plugins))
101}
102
103// get plugin
104pub async fn get_plugin(

Callers

nothing calls this directly

Calls 3

fetch_plugin_authorsFunction · 0.85
get_user_pluginsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected