use serde::Deserialize;
use crate::{
builders::EditChannel,
models::{Attachment, Channel, Id},
Context, Result,
};
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct VoiceChannel {
#[serde(rename = "_id")]
pub id: Id,
#[serde(rename = "server")]
pub server_id: Id,
pub name: String,
pub description: Option<String>,
pub icon: Option<Attachment>,
#[serde(default)]
pub nsfw: bool,
}
impl VoiceChannel {
pub async fn edit(&self, cx: &Context, builder: EditChannel) -> Result {
Channel::edit(cx, &self.id, builder).await
}
pub async fn delete(&self, cx: &Context) -> Result {
Channel::delete(cx, &self.id).await
}
}