add_role

Function add_role 

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

Adds a role to a user in a Discord 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 add the role to.
  • role_id - The ID of the role to add.

§Returns

A result indicating success or failure.