feat: clean up bot restrictions

This commit is contained in:
Paul Makles
2022-05-07 15:20:42 +01:00
parent 97fef56bad
commit 09e918d8e0
15 changed files with 59 additions and 9 deletions

View File

@@ -37,6 +37,10 @@ pub struct DataCreateGroup {
#[openapi(tag = "Groups")]
#[post("/create", data = "<info>")]
pub async fn req(db: &Db, user: User, info: Json<DataCreateGroup>) -> Result<Json<Channel>> {
if user.bot.is_some() {
return Err(Error::IsBot);
}
let info = info.into_inner();
info.validate()
.map_err(|error| Error::FailedValidation { error })?;