Furnyr / Dissonity

Open source project that makes it easy to interact with the Discord Embedded App SDK using Unity
MIT License
29 stars 5 forks source link

Sub voice update calls are not working #12

Open mvromanov opened 1 day ago

mvromanov commented 1 day ago

SubVoiceStateUpdate, SubSpeakingStart and SubSpeakingStop methods are not working.

Errors in the browser console looks like this:

args: "1194387531916128352" cmd: "SUBSCRIBE" evt: "SPEAKING_START"

code: 4000 message: "Invalid subscription parameters provided"

The reason for this error is the invalid format of the argument passed to discordSdk.subscribe() method:

            if (args == "channel_id") args = discordSdk!.channelId;

should be replaced with this:

            if (args.hasOwnProperty("channel_id")) {
                args.channel_id = discordSdk!.channelId;
            }

Reference to the Discord example: https://github.com/discord/embedded-app-sdk-examples/blob/main/sdk-playground/packages/client/src/pages/VoiceState.tsx#L18

Furnyr commented 1 day ago

Hi and thanks for opening the issue! This should be fixed in 223635a344f6a8caa520e5a55983ecbc93a29544 (Unity 1.1.4, NPM 1.2.1)

Let me know if it keeps happening 🙏