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

Function fetch_plugin

components/webapi/src/middlewares/plugins.rs:51–60  ·  view source on GitHub ↗
(config_store: &Db, plugin_id: u64)

Source from the content-addressed store, hash-verified

49}
50
51pub async fn fetch_plugin(config_store: &Db, plugin_id: u64) -> ApiResult<Plugin> {
52 config_store.get_plugin(plugin_id).await.map_err(|err| {
53 if matches!(err, ConfigStoreError::PluginNotFound(_)) {
54 ApiErrorResponse::PluginNotFound
55 } else {
56 error!(?err, "failed fetching plugin");
57 ApiErrorResponse::InternalError
58 }
59 })
60}

Callers 3

guild_add_pluginFunction · 0.85
update_script_pluginFunction · 0.85
plugin_middlewareFunction · 0.85

Calls 1

get_pluginMethod · 0.80

Tested by

no test coverage detected