forked from jmug/stoatchat
Restrict bots from creating servers, groups, acking messages, and making friends.
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
use crate::database::*;
|
||||
use crate::util::result::Result;
|
||||
use crate::util::result::{Error, Result};
|
||||
|
||||
use rocket::serde::json::Value;
|
||||
|
||||
#[get("/relationships")]
|
||||
pub async fn req(user: User) -> Result<Value> {
|
||||
if user.bot.is_some() {
|
||||
return Err(Error::IsBot)
|
||||
}
|
||||
|
||||
Ok(if let Some(vec) = user.relations {
|
||||
json!(vec)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user