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() -> EditMember<'a>
pub fn new() -> EditMember<'a>
Equivalent to Self::default
.
Sourcepub fn deafen(self, deafen: bool) -> EditMember<'a>
pub fn deafen(self, deafen: bool) -> EditMember<'a>
Whether to deafen the member.
Note: Requires the Deafen Members permission.
Sourcepub fn mute(self, mute: bool) -> EditMember<'a>
pub fn mute(self, mute: bool) -> EditMember<'a>
Whether to mute the member.
Note: Requires the Mute Members permission.
Sourcepub fn nickname(self, nickname: impl Into<String>) -> EditMember<'a>
pub fn nickname(self, nickname: impl Into<String>) -> EditMember<'a>
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>>,
) -> EditMember<'a>
pub fn roles( self, roles: impl IntoIterator<Item = impl Into<RoleId>>, ) -> EditMember<'a>
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>) -> EditMember<'a>
pub fn voice_channel(self, channel_id: impl Into<ChannelId>) -> EditMember<'a>
Move the member into a voice channel.
Note: Requires the Move Members permission.
Sourcepub fn disconnect_member(self) -> EditMember<'a>
pub fn disconnect_member(self) -> EditMember<'a>
Disconnects the user from their voice channel, if any.
Note: Requires the Move Members permission.
Sourcepub fn disable_communication_until(self, time: String) -> EditMember<'a>
pub fn disable_communication_until(self, time: String) -> EditMember<'a>
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,
) -> EditMember<'a>
pub fn disable_communication_until_datetime( self, time: Timestamp, ) -> EditMember<'a>
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) -> EditMember<'a>
pub fn enable_communication(self) -> EditMember<'a>
Allow a user to communicate, removing their timeout, if there is one.
Note: Requires the Moderate Members permission.
pub fn flags(self, flags: GuildMemberFlags) -> EditMember<'a>
Sourcepub fn audit_log_reason(self, reason: &'a str) -> EditMember<'a>
pub fn audit_log_reason(self, reason: &'a str) -> EditMember<'a>
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 CacheHttp + 'async_trait,
ctx: <EditMember<'_> as Builder>::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<<EditMember<'_> as Builder>::Built, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
EditMember<'_>: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl CacheHttp + 'async_trait,
ctx: <EditMember<'_> as Builder>::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<<EditMember<'_> as Builder>::Built, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
EditMember<'_>: '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