[docs]asyncdeffetch(self)->"VoiceState":""" Fetches the voice state of the member Returns ------- `VoiceState` The voice state of the member Raises ------ `NotFound` - If the member is not in the guild - If the member is not in a voice channel """ifnotself.guild_id:raiseValueError("Cannot fetch voice state without guild_id")r=awaitself._state.query("GET",f"/guilds/{self.guild_id}/voice-states/{self.id}")_guild=self._state.cache.get_guild(self.guild_id)_channel=Noneifself.channel_idisnotNone:_channel=self._state.cache.get_channel(self.guild_id,self.channel_id)returnVoiceState(state=self._state,data=r.response,guild=_guild,channel=_channel)
[docs]asyncdefedit(self,*,suppress:bool=MISSING,)->None:""" Updates the voice state of the member Parameters ---------- suppress: `bool` Whether to suppress the user """ifnotself.guild_id:raiseValueError("Cannot update voice state without guild_id")data:dict[str,Any]={}ifsuppressisnotMISSING:data["suppress"]=bool(suppress)awaitself._state.query("PATCH",f"/guilds/{self.guild_id}/voice-states/{int(self.id)}",json=data,res_method="text")