pub struct EditVoiceState { /* private fields */ }
Expand description
A builder which edits a user’s voice state, to be used in conjunction with
GuildChannel::edit_voice_state
.
Discord docs:
Implementations§
Source§impl EditVoiceState
impl EditVoiceState
Sourcepub fn new() -> Self
pub fn new() -> Self
Equivalent to Self::default
.
Sourcepub fn suppress(self, deafen: bool) -> Self
pub fn suppress(self, deafen: bool) -> Self
Whether to suppress the user. Setting this to false will invite a user to speak.
Note: Requires the Mute Members permission to suppress another user or unsuppress the current user. This is not required if suppressing the current user.
Sourcepub fn request_to_speak(self, request: bool) -> Self
pub fn request_to_speak(self, request: bool) -> Self
Requests or clears a request to speak. Passing true
is equivalent to passing the current
time to Self::request_to_speak_timestamp
.
Note: Requires the Request to Speak permission.
Sourcepub fn request_to_speak_timestamp(self, timestamp: impl Into<Timestamp>) -> Self
pub fn request_to_speak_timestamp(self, timestamp: impl Into<Timestamp>) -> Self
Sets the current bot user’s request to speak timestamp. This can be any present or future time.
Note: Requires the Request to Speak permission.
Trait Implementations§
Source§impl Builder for EditVoiceState
impl Builder for EditVoiceState
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 given user’s voice state in a stage channel. Providing a UserId
will edit
that user’s voice state, otherwise the current user’s voice state will be edited.
Note: Requires the Request to Speak permission. Also requires the Mute Members permission to suppress another user or unsuppress the current user. This is not required if suppressing the current user.
§Errors
Returns Error::Http
if the user lacks permission, or if invalid data is given.
Source§type Context<'ctx> = (GuildId, ChannelId, Option<UserId>)
type Context<'ctx> = (GuildId, ChannelId, Option<UserId>)
type Built = ()
Source§impl Clone for EditVoiceState
impl Clone for EditVoiceState
Source§fn clone(&self) -> EditVoiceState
fn clone(&self) -> EditVoiceState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more