Add delete route for bots. Closes #8.

This commit is contained in:
Paul
2021-08-12 14:28:46 +01:00
parent bd3606176a
commit b3bdf403cf
3 changed files with 67 additions and 5 deletions

View File

@@ -39,11 +39,8 @@ pub async fn edit_bot(user: User, target: Ref, data: Json<Data>) -> Result<()> {
}
let bot = target.fetch_bot().await?;
if !bot.public {
if bot.owner != user.id {
return Err(Error::BotIsPrivate);
}
if bot.owner != user.id {
return Err(Error::MissingPermission);
}
if let Some(name) = &data.name {