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
.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for AddRoleToMember<'a>
impl<'a> Send for AddRoleToMember<'a>
impl<'a> Sync for AddRoleToMember<'a>
impl<'a> Unpin for AddRoleToMember<'a>
impl<'a> !UnwindSafe for AddRoleToMember<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more