#[non_exhaustive]pub struct ModifyGuildMember {
pub nick: Patch<CompactString>,
pub roles: Patch<Vec<RoleId>>,
pub mute: Patch<bool>,
pub deaf: Patch<bool>,
pub channel_id: Patch<ChannelId>,
pub communication_disabled_until: Patch<Timestamp>,
pub flags: Patch<MemberFlags>,
}Expand description
The body of Modify Guild Member.
Every field is optional and can be cleared.
discord.js counterpart: GuildMemberEditOptions.
§Examples
use djs_model::{rest::ModifyGuildMember, util::{Patch, Timestamp}};
// A timeout until one hour after 2027-01-15 08:00 UTC.
let until = Timestamp::from_unix_secs(1_800_000_000 + 3600).unwrap();
let mut body = ModifyGuildMember::default();
body.communication_disabled_until = Patch::Set(until);
assert_eq!(
serde_json::to_string(&body).unwrap(),
r#"{"communication_disabled_until":"2027-01-15T09:00:00.000000+00:00"}"#
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nick: Patch<CompactString>The nickname (needs MANAGE_NICKNAMES).
roles: Patch<Vec<RoleId>>The roles, all of them (needs MANAGE_ROLES).
mute: Patch<bool>Whether the member is muted in voice channels (needs MUTE_MEMBERS; the member must
be connected).
deaf: Patch<bool>Whether the member is deafened in voice channels (needs DEAFEN_MEMBERS; the member
must be connected).
channel_id: Patch<ChannelId>The voice channel to move the member to (needs MOVE_MEMBERS and CONNECT there);
Patch::Clear disconnects them.
communication_disabled_until: Patch<Timestamp>When the member’s timeout
ends (at most 28 days ahead; needs MODERATE_MEMBERS); Patch::Clear ends it.
flags: Patch<MemberFlags>The member’s flags (only some can be set).
Trait Implementations§
Source§impl Clone for ModifyGuildMember
impl Clone for ModifyGuildMember
Source§impl Debug for ModifyGuildMember
impl Debug for ModifyGuildMember
Source§impl Default for ModifyGuildMember
impl Default for ModifyGuildMember
impl Eq for ModifyGuildMember
Source§impl Hash for ModifyGuildMember
impl Hash for ModifyGuildMember
Source§impl PartialEq for ModifyGuildMember
impl PartialEq for ModifyGuildMember
Source§impl Serialize for ModifyGuildMember
impl Serialize for ModifyGuildMember
impl StructuralPartialEq for ModifyGuildMember
Auto Trait Implementations§
impl Forget for ModifyGuildMember
impl Freeze for ModifyGuildMember
impl Move for ModifyGuildMember
impl RefUnwindSafe for ModifyGuildMember
impl Send for ModifyGuildMember
impl Sync for ModifyGuildMember
impl Unpin for ModifyGuildMember
impl UnsafeUnpin for ModifyGuildMember
impl UnwindSafe for ModifyGuildMember
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more