pub async fn edit_channel(
        &self,
        channel_id: ChannelId,
        name: Option<String>,
        description: Option<String>,
        icon: Option<AttachmentId>,
        nsfw: Option<bool>,
        remove: Option<ChannelField>,
    ) -> Result {
        #[derive(serde::Serialize)]
        struct PatchChannelRequest {
            #[serde(skip_serializing_if = "Option::is_none")]
            name: Option<String>,
            #[serde(skip_serializing_if = "Option::is_none")]
            description: Option<String>,
            #[serde(skip_serializing_if = "Option::is_none")]
            icon: Option<AttachmentId>,
            #[serde(skip_serializing_if = "Option::is_none")]
            nsfw: Option<bool>,
            #[serde(skip_serializing_if = "Option::is_none")]
            remove: Option<ChannelField>,
        }

        self.client
            .patch(ep!(self, "/channels/{}" channel_id))
            .json(&PatchChannelRequest {
                name,
                description,
                icon,
                nsfw,
                remove,
            })
            .send()
            .await?
            .error_for_status()?;

        Ok(())
    }
/// Edits the channel given by id
Edits the channel given by id
Edits the channel given by id
pub async fn edit_channel(
        &self,
        channel_id: ChannelId,
        name: Option<String>,
        description: Option<String>,
        icon: Option<AttachmentId>,
        nsfw: Option<bool>,
        remove: Option<ChannelField>,
    ) -> Result {
        #[derive(serde::Serialize)]
        struct PatchChannelRequest {
            #[serde(skip_serializing_if = "Option::is_none")]
            name: Option<String>,
            #[serde(skip_serializing_if = "Option::is_none")]
            description: Option<String>,
            #[serde(skip_serializing_if = "Option::is_none")]
            icon: Option<AttachmentId>,
            #[serde(skip_serializing_if = "Option::is_none")]
            nsfw: Option<bool>,
            #[serde(skip_serializing_if = "Option::is_none")]
            remove: Option<ChannelField>,
        }
        self.client
            .patch(ep!(self, "/channels/{}" channel_id))
            .json(&PatchChannelRequest {
                name,
                description,
                icon,
                nsfw,
                remove,
            })
            .send()
            .await?
            .error_for_status()?;
        Ok(())
    }
pub async fn edit_channel ( & self , channel_id : ChannelId , name : Option < String > , description : Option < String > , icon : Option < AttachmentId > , nsfw : Option < bool > , remove : Option < ChannelField > , ) -> Result { # [ derive ( serde Serialize ) ] struct PatchChannelRequest { # [ serde ( skip_serializing_if " " ) ] name : Option < String > , # [ serde ( skip_serializing_if " " ) ] description : Option < String > , # [ serde ( skip_serializing_if " " ) ] icon : Option < AttachmentId > , # [ serde ( skip_serializing_if " " ) ] nsfw : Option < bool > , # [ serde ( skip_serializing_if " " ) ] remove : Option < ChannelField > , } self . client . patch ( ep ! ( self " " channel_id ) ) . json ( & PatchChannelRequest { name , description , icon , nsfw , remove , } ) . send ( ) . await ? . error_for_status ( ) ? ; Ok ( ( ) ) }
Edits the channel given by id
Edits the channel given by id
&self
channel_id
ChannelId
name
Option<String>
description
Option<String>
icon
Option<AttachmentId>
nsfw
Option<bool>
remove
Option<ChannelField>
&self
channel_id
ChannelId
name
Option<String>
description
Option<String>
icon
Option<AttachmentId>
nsfw
Option<bool>
remove
Option<ChannelField>