dico.voice.client module
- class dico.voice.client.VoiceClient(client, ws)
Bases:
objectClient dedicated for voice control.
Warning
You should create this instance using
connect_voice().- Parameters:
client (Client) – Client of your bot.
ws (VoiceWebsocket) – Voice Websocket instance.
~.client (Client) – Client of your bot.
~.ws (VoiceWebsocket) – Voice Websocket instance.
- async close()
Closes and terminates voice instance.
- voice_state_update(payload)
Updates websocket session ID using received voice state payload.
Note
This is automatically handled inside the client.
- Parameters:
payload (VoiceState) – Voice state payload received.
- voice_server_update(payload)
Sets new voice server using voice server update payload.
Note
This is automatically handled inside the client.
- Parameters:
payload (VoiceServerUpdate) – Voice server update payload received.
- async play(audio, *, lock_audio=False)
Plays audio.
- pause()
Pauses player.
- resume()
Resumes paused player.
- async stop()
Stops player.
- async wait_audio_done()
Waits until current audio is done playing.
Note
This will never done if audio is locked.
- property playing
Whether audio is loaded.
- property paused
Whether player is paused.
- property audio
Current audio playing.
- async classmethod connect(client, payload, voice_state, wait_ready=True)
Connects to the voice.
Warning
You should connect using
connect_voice().- Parameters:
client (Client) – Client of your bot.
payload (VoiceServerUpdate) – Voice server update payload received.
voice_state (VoiceState) – Voice state payload received.
wait_ready (bool) – Whether to wait until websocket is ready.
- Returns: