Struct twilight_http::request::guild::role::CreateRole
source · [−]pub struct CreateRole<'a> { /* private fields */ }
Expand description
Create a role in a guild.
Examples
use twilight_http::Client;
use twilight_model::id::Id;
let client = Client::new("my token".to_owned());
let guild_id = Id::new(234);
client.create_role(guild_id)
.color(0xd90083)
.name("Bright Pink")
.exec()
.await?;
Implementations
Set the icon of the role.
Only works if the guild has the ROLE_ICONS
feature.
If true, the role can be @mentioned (pinged) in chat.
Set the name of the role.
If none is specified, Discord sets this to New Role
.
Set the allowed permissions of this role.
Set the unicode emoji of a role.
pub fn exec(self) -> ResponseFuture<Role>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<Role>ⓘ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 CreateRole<'a>
impl<'a> Send for CreateRole<'a>
impl<'a> Sync for CreateRole<'a>
impl<'a> Unpin for CreateRole<'a>
impl<'a> !UnwindSafe for CreateRole<'a>
Blanket Implementations
Mutably borrows from an owned value. 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