Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivia committed Jun 17, 2024
1 parent d38729d commit cb6a8ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/botowners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ pub async fn getbotroles(ctx: Context<'_>) -> Result<(), Error> {
let member = ctx.author_member().await;

if let Some(member) = member {
let owned = crate::impls::utils::get_owned_by(&id, &data.pool).await?;
let owned_bots = crate::impls::utils::get_owned_by(&id, &data.pool).await?;

let owned_bots: Vec<crate::impls::utils::OwnedBy> = owned.iter().filter(|x| x.target_type == crate::impls::target_type::TargetType::Bot).collect();

if owned_bots.is_empty() {
return Err("You are not the owner/additional owner of any bots".into());
}
Expand Down Expand Up @@ -120,4 +118,4 @@ pub async fn getbotroles(ctx: Context<'_>) -> Result<(), Error> {
}

Ok(())
}
}

0 comments on commit cb6a8ab

Please sign in to comment.