Function ban_user

Source
pub async fn ban_user(
    client: &Client,
    token: &str,
    guild_id: &str,
    user_id: &str,
    delete_message_days: u8,
    reason: &str,
) -> Result<(), Box<dyn Error>>
Expand description

Bans a user from a guild.

§Arguments

  • client - The HTTP client used to send the request.
  • token - The bot token for authentication.
  • guild_id - The ID of the guild.
  • user_id - The ID of the user to ban.
  • delete_message_days - The number of days to delete messages for (0-7).
  • reason - The reason for the ban.

§Returns

A result indicating success or failure.