feat: implement channel invites, perms, group create, members fetch

chore: when you accidentally run fmt
This commit is contained in:
Paul Makles
2022-02-04 21:50:30 +00:00
parent b58755dbeb
commit 88f811761b
59 changed files with 536 additions and 195 deletions

View File

@@ -1,7 +1,7 @@
use revolt_quark::Result;
use rauth::util::EmptyResponse;
use revolt_quark::Result;
#[delete("/<target>")]
pub async fn delete_bot(/*user: UserRef, target: Ref*/ target: String) -> Result<EmptyResponse> {
pub async fn delete_bot(/*user: UserRef, target: Ref*/ target: String,) -> Result<EmptyResponse> {
todo!()
}

View File

@@ -1,6 +1,6 @@
use crate::util::regex::RE_USERNAME;
use revolt_quark::{Result, models::bot::FieldsBot, EmptyResponse};
use revolt_quark::{models::bot::FieldsBot, EmptyResponse, Result};
use mongodb::bson::doc;
use rocket::serde::json::Json;
@@ -19,6 +19,9 @@ pub struct Data {
}
#[patch("/<target>", data = "<data>")]
pub async fn edit_bot(/*user: UserRef, target: Ref,*/ target: String, data: Json<Data>) -> Result<EmptyResponse> {
pub async fn edit_bot(
/*user: UserRef, target: Ref,*/ target: String,
data: Json<Data>,
) -> Result<EmptyResponse> {
todo!()
}

View File

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

View File

@@ -1,12 +1,12 @@
use rocket::Route;
mod create;
mod invite;
mod fetch_public;
mod delete;
mod edit;
mod fetch;
mod fetch_owned;
mod edit;
mod delete;
mod fetch_public;
mod invite;
pub fn routes() -> Vec<Route> {
routes![