Struct twilight_http::request::guild::member::AddRoleToMember [−][src]
pub struct AddRoleToMember<'a> { /* fields omitted */ }Expand description
Add a role to a member in a guild.
Examples
In guild 1, add role 2 to user 3, for the reason "test":
use twilight_http::{request::AuditLogReason, Client}; use twilight_model::id::{GuildId, RoleId, UserId}; let client = Client::new("my token".to_owned()); let guild_id = GuildId(1); let role_id = RoleId(2); let user_id = UserId(3); client.add_guild_member_role(guild_id, user_id, role_id) .reason("test")? .exec() .await?;
Implementations
pub fn exec(self) -> ResponseFuture<EmptyBody>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<EmptyBody>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
Notable traits for ResponseFuture<T>
impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;Execute the request, returning a future resolving to a Response.