File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -4104,6 +4104,27 @@ impl Http {
41044104 . await
41054105 }
41064106
4107+ /// Get User Voice State
4108+ /// Returns the specified user's voice state in the guild.
4109+ pub async fn get_user_voice_state (
4110+ & self ,
4111+ guild_id : GuildId ,
4112+ user_id : UserId ,
4113+ ) -> Result < VoiceState > {
4114+ self . fire ( Request {
4115+ body : None ,
4116+ multipart : None ,
4117+ headers : None ,
4118+ method : LightMethod :: Get ,
4119+ route : Route :: GuildVoiceStates {
4120+ guild_id,
4121+ user_id,
4122+ } ,
4123+ params : None
4124+ } )
4125+ . await
4126+ }
4127+
41074128 /// Retrieves a webhook given its Id.
41084129 ///
41094130 /// This method requires authentication, whereas [`Http::get_webhook_with_token`] and
Original file line number Diff line number Diff line change @@ -1149,6 +1149,15 @@ impl GuildId {
11491149 MembersIter :: stream ( http, self )
11501150 }
11511151
1152+ /// Gets a user's voice state in this guild.
1153+ ///
1154+ /// # Errors
1155+ ///
1156+ /// Returns [`Error::Http`] if the user is not in a voice channel in this guild.
1157+ pub async fn get_user_voice_state ( self , http : & Http , user_id : UserId ) -> Result < VoiceState > {
1158+ http. get_user_voice_state ( self , user_id) . await
1159+ }
1160+
11521161 /// Moves a member to a specific voice channel.
11531162 ///
11541163 /// **Note**: Requires the [Move Members] permission.
You can’t perform that action at this time.
0 commit comments