Servers: Add TextChannel.
This commit is contained in:
@@ -108,5 +108,6 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Channel::TextChannel { .. } => unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,13 +39,24 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
|
||||
}
|
||||
|
||||
let id = Ulid::new().to_string();
|
||||
let cid = Ulid::new().to_string();
|
||||
|
||||
Channel::TextChannel {
|
||||
id: cid.clone(),
|
||||
server: id.clone(),
|
||||
nonce: Some(info.nonce.clone()),
|
||||
name: "general".to_string(),
|
||||
description: None,
|
||||
icon: None,
|
||||
}.publish().await?;
|
||||
|
||||
let server = Server {
|
||||
id: id.clone(),
|
||||
nonce: Some(info.nonce.clone()),
|
||||
owner: user.id.clone(),
|
||||
|
||||
name: info.name.clone(),
|
||||
channels: vec![],
|
||||
channels: vec![ cid ],
|
||||
|
||||
icon: None,
|
||||
banner: None,
|
||||
|
||||
Reference in New Issue
Block a user