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

Method get_plugins

components/stores/src/config.rs:1038–1074  ·  view source on GitHub ↗
(&self, plugin_ids: &[u64])

Source from the content-addressed store, hash-verified

1036 }
1037
1038 pub async fn get_plugins(&self, plugin_ids: &[u64]) -> ConfigStoreResult<Vec<Plugin>> {
1039 let ids = plugin_ids.iter().map(|v| *v as i64).collect::<Vec<_>>();
1040 let raw_plugins = sqlx::query_as!(
1041 DbPlugin,
1042 r#"SELECT id,
1043created_at,
1044name,
1045short_description,
1046long_description,
1047is_published,
1048is_official,
1049plugin_kind,
1050current_version_number,
1051script_published_source,
1052script_published_version_updated_at,
1053script_dev_source,
1054script_dev_version_updated_at,
1055author_id,
1056is_public,
1057discord_thread_id,
1058installed_guilds,
1059installed_guilds_updated_at
1060FROM plugins WHERE id = ANY($1)
1061ORDER BY id ASC"#,
1062 &ids,
1063 )
1064 .fetch_all(&self.pool)
1065 .await?;
1066
1067 let mut res: Vec<Plugin> = Vec::new();
1068 for plugin in raw_plugins.into_iter() {
1069 let images = self.get_plugin_images_with_pool(plugin.id as u64).await?;
1070 res.push(PluginAndImages(plugin, images).into());
1071 }
1072
1073 Ok(res)
1074 }
1075
1076 pub async fn get_user_plugins(&self, user_id: u64) -> ConfigStoreResult<Vec<Plugin>> {
1077 let raw_plugins = sqlx::query_as!(

Callers 1

Calls 2

PluginAndImagesClass · 0.85

Tested by

no test coverage detected