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

Method get_user_plugins

components/stores/src/config.rs:1076–1111  ·  view source on GitHub ↗
(&self, user_id: u64)

Source from the content-addressed store, hash-verified

1074 }
1075
1076 pub async fn get_user_plugins(&self, user_id: u64) -> ConfigStoreResult<Vec<Plugin>> {
1077 let raw_plugins = sqlx::query_as!(
1078 DbPlugin,
1079 r#"SELECT id,
1080created_at,
1081name,
1082short_description,
1083long_description,
1084is_published,
1085is_official,
1086plugin_kind,
1087current_version_number,
1088script_published_source,
1089script_published_version_updated_at,
1090script_dev_source,
1091script_dev_version_updated_at,
1092author_id,
1093is_public,
1094discord_thread_id,
1095installed_guilds,
1096installed_guilds_updated_at
1097FROM plugins WHERE author_id = $1
1098ORDER BY id ASC"#,
1099 user_id as i64,
1100 )
1101 .fetch_all(&self.pool)
1102 .await?;
1103
1104 let mut res: Vec<Plugin> = Vec::new();
1105 for plugin in raw_plugins.into_iter() {
1106 let images = self.get_plugin_images_with_pool(plugin.id as u64).await?;
1107 res.push(PluginAndImages(plugin, images).into());
1108 }
1109
1110 Ok(res)
1111 }
1112
1113 pub async fn get_published_public_plugins(&self) -> ConfigStoreResult<Vec<Plugin>> {
1114 let raw_plugins = sqlx::query_as!(

Callers 2

get_user_pluginsFunction · 0.80
create_pluginFunction · 0.80

Calls 2

PluginAndImagesClass · 0.85

Tested by

no test coverage detected