fix: deny access for bot creating a server (#238)

This commit is contained in:
ToastXC
2023-04-20 11:04:51 +01:00
committed by GitHub
parent 36dd128459
commit b9d813d8f0
@@ -44,6 +44,10 @@ pub async fn req(
user: User,
info: Json<DataCreateServer>,
) -> Result<Json<CreateServerResponse>> {
if user.bot.is_some() {
return Err(Error::IsBot);
}
let info = info.into_inner();
info.validate()
.map_err(|error| Error::FailedValidation { error })?;