Files
stoatchat/src/routes/bots/invite.rs
2022-01-27 14:16:30 +00:00

27 lines
524 B
Rust

use revolt_quark::{EmptyResponse, Result};
use rocket::serde::json::Json;
use serde::Deserialize;
#[derive(Deserialize)]
pub struct ServerId {
server: String
}
#[derive(Deserialize)]
pub struct GroupId {
group: String
}
#[derive(Deserialize)]
#[serde(untagged)]
pub enum Destination {
Server(ServerId),
Group(GroupId)
}
#[post("/<target>/invite", data = "<dest>")]
pub async fn invite_bot(/*user: UserRef, target: Ref,*/ target: String, dest: Json<Destination>) -> Result<EmptyResponse> {
todo!()
}