disgoorg / disgolink

A Golang Lavalink Client
Apache License 2.0
24 stars 4 forks source link

How to use VoiceStateUpdate/VoiceServerUpdate ? #30

Closed fiwippi closed 2 years ago

fiwippi commented 2 years ago

Hi, I've looked around at this repo and the Lavalink docs and apart from having to join a voice channel and sending the play command to Lavalink, you also have to send VoiceStateUpdate or VoiceServerUpdate op to Lavalink (I'm not sure which one).

Could you please explain/provide an example?

For context I'm using the non-specific implementation.

Thanks

topi314 commented 2 years ago

Which discord library are you using?

topi314 commented 2 years ago

When connecting to a voice channel you need to send a voice state update command over the gateway https://discord.com/developers/docs/topics/gateway#update-voice-state

This then fires a voice state update & voice server update

Both of them need to be forwarded to lavalink

This can be done via lavalink.VoiceStateUpdate(event) and lavalink.VoiceServerUpdate(event)

topi314 commented 2 years ago

I'll update the docs to include that later

fiwippi commented 2 years ago

Thanks (i'm using Arikawa)

topi314 commented 2 years ago

I'd be open for a simple wrapper like https://github.com/DisgoOrg/disgolink/tree/master/dgolink or https://github.com/DisgoOrg/disgolink/tree/master/disgolink for arikawa

you can pr it or I'll do it how you like

fiwippi commented 2 years ago

I'm happy to do it but I'm about to start a new semester so it might take a while... :(

topi314 commented 2 years ago

alright dw about it then