#[non_exhaustive]pub struct ModifyCurrentUserVoiceState {
pub channel_id: Option<ChannelId>,
pub suppress: Option<bool>,
pub request_to_speak_timestamp: Patch<Timestamp>,
}Expand description
The body of Modify Current User Voice State.
Every field is optional. Unsuppressing needs MUTE_MEMBERS and requesting to speak needs
REQUEST_TO_SPEAK; suppressing oneself and withdrawing a request always work.
discord.js counterpart: the argument of VoiceState#edit for the client user
(setSuppressed, setRequestToSpeak).
§Examples
use djs_model::{
id::ChannelId,
rest::ModifyCurrentUserVoiceState,
util::{Patch, Timestamp},
};
let mut body = ModifyCurrentUserVoiceState::default();
body.channel_id = Some(ChannelId::new(5));
body.request_to_speak_timestamp = Patch::Set(Timestamp::parse("2026-11-12T18:00:00Z")?);
assert_eq!(
serde_json::to_string(&body)?,
r#"{"channel_id":"5","request_to_speak_timestamp":"2026-11-12T18: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.channel_id: Option<ChannelId>The stage channel the bot is in.
suppress: Option<bool>Whether the bot is suppressed (an audience member rather than a speaker).
request_to_speak_timestamp: Patch<Timestamp>Requests to speak (any present or future time); Patch::Clear withdraws the request.
Trait Implementations§
Source§impl Clone for ModifyCurrentUserVoiceState
impl Clone for ModifyCurrentUserVoiceState
impl Copy for ModifyCurrentUserVoiceState
Source§impl Debug for ModifyCurrentUserVoiceState
impl Debug for ModifyCurrentUserVoiceState
impl Eq for ModifyCurrentUserVoiceState
Source§impl Hash for ModifyCurrentUserVoiceState
impl Hash for ModifyCurrentUserVoiceState
impl StructuralPartialEq for ModifyCurrentUserVoiceState
Auto Trait Implementations§
impl Forget for ModifyCurrentUserVoiceState
impl Freeze for ModifyCurrentUserVoiceState
impl Move for ModifyCurrentUserVoiceState
impl RefUnwindSafe for ModifyCurrentUserVoiceState
impl Send for ModifyCurrentUserVoiceState
impl Sync for ModifyCurrentUserVoiceState
impl Unpin for ModifyCurrentUserVoiceState
impl UnsafeUnpin for ModifyCurrentUserVoiceState
impl UnwindSafe for ModifyCurrentUserVoiceState
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