pub struct EditMember<'a> { /* private fields */ }
Expand description
A builder which edits the properties of a Member
, to be used in conjunction with
Member::edit
.
Implementations§
Source§impl<'a> EditMember<'a>
impl<'a> EditMember<'a>
Sourcepub fn new() -> Self
pub fn new() -> Self
Equivalent to Self::default
.
Sourcepub fn deafen(self, deafen: bool) -> Self
pub fn deafen(self, deafen: bool) -> Self
Whether to deafen the member.
Note: Requires the Deafen Members permission.
Sourcepub fn mute(self, mute: bool) -> Self
pub fn mute(self, mute: bool) -> Self
Whether to mute the member.
Note: Requires the Mute Members permission.
Sourcepub fn nickname(self, nickname: impl Into<String>) -> Self
pub fn nickname(self, nickname: impl Into<String>) -> Self
Changes the member’s nickname. Pass an empty string to reset the nickname.
Note: 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
Set the list of roles that the member should have.
Note: Requires the Manage Roles permission to modify.
Sourcepub fn voice_channel(self, channel_id: impl Into<ChannelId>) -> Self
pub fn voice_channel(self, channel_id: impl Into<ChannelId>) -> Self
Move the member into a voice channel.
Note: Requires the Move Members permission.
Sourcepub fn disconnect_member(self) -> Self
pub fn disconnect_member(self) -> Self
Disconnects the user from their voice channel, if any.
Note: Requires the Move Members permission.
Sourcepub fn disable_communication_until(self, time: String) -> Self
pub fn disable_communication_until(self, time: String) -> Self
Times the user out until time
, an ISO8601-formatted datetime string.
time
is considered invalid if it is not a valid ISO8601 timestamp or if it is greater
than 28 days from the current time.
Note: Requires the Moderate Members permission.
Sourcepub fn disable_communication_until_datetime(self, time: Timestamp) -> Self
pub fn disable_communication_until_datetime(self, time: Timestamp) -> Self
Times the user out until time
.
time
is considered invalid if it is greater than 28 days from the current time.
Note: Requires the Moderate Members permission.
Sourcepub fn enable_communication(self) -> Self
pub fn enable_communication(self) -> Self
Allow a user to communicate, removing their timeout, if there is one.
Note: Requires the Moderate Members permission.
pub fn flags(self, flags: GuildMemberFlags) -> Self
Sourcepub fn audit_log_reason(self, reason: &'a str) -> Self
pub fn audit_log_reason(self, reason: &'a str) -> Self
Sets the request’s audit log reason.
Trait Implementations§
Source§impl Builder for EditMember<'_>
impl Builder for EditMember<'_>
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,
Edits the properties of the guild member.
For details on permissions requirements, refer to each specific method.
§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 = Member
Source§impl<'a> Clone for EditMember<'a>
impl<'a> Clone for EditMember<'a>
Source§fn clone(&self) -> EditMember<'a>
fn clone(&self) -> EditMember<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more