pub struct AddMember { /* private fields */ }builder only.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.
Source§type Context<'ctx> = (GuildId, UserId)
type Context<'ctx> = (GuildId, UserId)
type Built = Option<Member>
Auto Trait Implementations§
impl Freeze for AddMember
impl RefUnwindSafe for AddMember
impl Send for AddMember
impl Sync for AddMember
impl Unpin for AddMember
impl UnwindSafe for AddMember
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)