pub struct AddMember { /* private fields */ }
Expand description
A builder to add parameters when using GuildId::add_member
.
Implementations§
Source§impl AddMember
impl AddMember
Sourcepub fn new(access_token: String) -> Self
pub fn new(access_token: String) -> Self
Constructs a new builder with the given access token, leaving all other fields empty.
Sourcepub fn access_token(self, access_token: impl Into<String>) -> Self
pub fn access_token(self, access_token: impl Into<String>) -> Self
Sets the OAuth2 access token for this request, replacing the current one.
Requires the access token to have the guilds.join
scope granted.
Sourcepub fn nickname(self, nickname: impl Into<String>) -> Self
pub fn nickname(self, nickname: impl Into<String>) -> Self
Sets the member’s nickname.
Requires the Manage Nicknames permission.
Sourcepub fn roles(self, roles: impl IntoIterator<Item = impl Into<RoleId>>) -> Self
pub fn roles(self, roles: impl IntoIterator<Item = impl Into<RoleId>>) -> Self
Sets the list of roles that the member should have.
Requires the Manage Roles permission.
Sourcepub fn mute(self, mute: bool) -> Self
pub fn mute(self, mute: bool) -> Self
Whether to mute the member.
Requires the Mute Members permission.
Sourcepub fn deafen(self, deafen: bool) -> Self
pub fn deafen(self, deafen: bool) -> Self
Whether to deafen the member.
Requires the Deafen Members permission.
Trait Implementations§
Source§impl Builder for AddMember
impl Builder for AddMember
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds a User
to this guild with a valid OAuth2 access token.
Returns the created Member
object, or nothing if the user is already a member of the
guild.
§Errors
Returns Error::Http
if the current user lacks permission, or if invalid data is given.