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

Method get_enabled_script_command_contributes

components/stores/src/config.rs:405–423  ·  view source on GitHub ↗

Command contributions of the guild's enabled scripts, without dragging script sources along.

(
        &self,
        guild_id: Id<GuildMarker>,
    )

Source from the content-addressed store, hash-verified

403 /// Command contributions of the guild's enabled scripts, without dragging
404 /// script sources along.
405 pub async fn get_enabled_script_command_contributes(
406 &self,
407 guild_id: Id<GuildMarker>,
408 ) -> ConfigStoreResult<Vec<Vec<twilight_model::application::command::Command>>> {
409 let rows = sqlx::query!(
410 "SELECT d.contributes_commands FROM guild_script_derived d
411 INNER JOIN guild_scripts s ON s.id = d.script_id
412 WHERE d.guild_id = $1 AND s.enabled
413 ORDER BY d.script_id ASC",
414 guild_id.get() as i64,
415 )
416 .fetch_all(&self.pool)
417 .await?;
418
419 Ok(rows
420 .into_iter()
421 .map(|row| serde_json::from_value(row.contributes_commands).unwrap_or_default())
422 .collect())
423 }
424
425 async fn attach_script_derived(
426 conn: &mut PgConnection,

Callers 1

update_guild_commandsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected