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

Method del_script

components/stores/src/config.rs:458–476  ·  view source on GitHub ↗
(
        &self,
        guild_id: Id<GuildMarker>,
        script_name: String,
    )

Source from the content-addressed store, hash-verified

456 }
457
458 pub async fn del_script(
459 &self,
460 guild_id: Id<GuildMarker>,
461 script_name: String,
462 ) -> ConfigStoreResult<()> {
463 let res = sqlx::query!(
464 "DELETE FROM guild_scripts WHERE guild_id = $1 AND name = $2;",
465 guild_id.get() as i64,
466 script_name
467 )
468 .execute(&self.pool)
469 .await?;
470
471 if res.rows_affected() > 0 {
472 Ok(())
473 } else {
474 Err(ConfigStoreError::ScriptNotFound)
475 }
476 }
477
478 pub async fn list_scripts(&self, guild_id: Id<GuildMarker>) -> ConfigStoreResult<Vec<Script>> {
479 Self::get_guild_scripts(&mut *self.pool.acquire().await?, guild_id).await

Callers 2

newMethod · 0.80
delete_guild_scriptFunction · 0.80

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected