pub async fn ban_user(
        &self,
        server_id: ServerId,
        user_id: UserId,
        reason: Option<&str>,
    ) -> Result {
        #[derive(serde::Serialize)]
        struct BanRequest<'a> {
            #[serde(skip_serializing_if = "Option::is_none")]
            reason: Option<&'a str>,
        }
        self.client
            .put(ep!(self, "/servers/{}/bans/{}" server_id, user_id))
            .json(&BanRequest { reason })
            .send()
            .await?
            .error_for_status()?;

        Ok(())
    }
/// Bans an user from the server
Bans an user from the server
Bans an user from the server
pub async fn ban_user(
        &self,
        server_id: ServerId,
        user_id: UserId,
        reason: Option<&str>,
    ) -> Result {
        #[derive(serde::Serialize)]
        struct BanRequest<'a> {
            #[serde(skip_serializing_if = "Option::is_none")]
            reason: Option<&'a str>,
        }
        self.client
            .put(ep!(self, "/servers/{}/bans/{}" server_id, user_id))
            .json(&BanRequest { reason })
            .send()
            .await?
            .error_for_status()?;
        Ok(())
    }
pub async fn ban_user ( & self , server_id : ServerId , user_id : UserId , reason : Option < & str > , ) -> Result { # [ derive ( serde Serialize ) ] struct BanRequest < ' a > { # [ serde ( skip_serializing_if " " ) ] reason : Option < & ' a str > , } self . client . put ( ep ! ( self " " server_id user_id ) ) . json ( & BanRequest { reason } ) . send ( ) . await ? . error_for_status ( ) ? ; Ok ( ( ) ) }
Bans an user from the server
Bans an user from the server
&self
server_id
ServerId
user_id
UserId
reason
Option<&str>
&self
server_id
ServerId
user_id
UserId
reason
Option<&str>