1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Bodies of the [voice endpoints](https://docs.discord.com/developers/resources/voice).
//!
//! Both bodies only work in stage channels the user has already joined.
use Serialize;
use crate::;
/// The body of [Modify Current User Voice State](https://docs.discord.com/developers/resources/voice#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"}"#
/// );
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
/// The body of [Modify User Voice State](https://docs.discord.com/developers/resources/voice#modify-user-voice-state).
///
/// Every field is optional; needs `MUTE_MEMBERS`. Unsuppressing a user who is not a bot also
/// sets their request to speak to now; suppressing removes it.
///
/// discord.js counterpart: the argument of `VoiceState#edit` for other members
/// (`setSuppressed`).