SinisterRectus / Discordia

Discord API library written in Lua for the Luvit runtime environment
MIT License
688 stars 144 forks source link

Connection issue in voice #394

Open ProGrovv opened 1 year ago

ProGrovv commented 1 year ago

I just set connection to channel:join() and play audio file by FFmpeg, but connection is nil, I don't know where is a problem, because in discord the bot connects to the channel

I only receive warnings: Unhandled WebSocket payload OP 18 Unhandled WebSocket payload OP 20

Thank you for help in advance!

MeteorTheLizard commented 1 year ago

Unhandled WebSocket payload OP 18 Unhandled WebSocket payload OP 20

These errors happen all the time, these payloads are undocumented on discords end, and I'm going to assume that they're used to receive audio data which you're not supposed to do anything with.

https://discord.com/developers/docs/topics/opcodes-and-status-codes

Bilal2453 commented 1 year ago

This problem has nothing to do with the unhandled payloads indeed. It is due to the breaking changes Discord has introduced. It was solved in the latest Discordia commits, the update is not yet pushed to Lit's upstream. Update your Discordia installation from this repo (delete /deps/discordia then do git clone https://github.com/SinisterRectus/Discordia ./deps/discordia).

Also, if you want to know why is something erroring (returning nil), check the second return, Discordia methods return nil, string on HTTP errors, the string is used to describe the issue.

You would have had more luck asking in our Discord server over here by the way.