Cogmasters / concord

A Discord API wrapper library made in C
https://cogmasters.github.io/concord/
MIT License
522 stars 30 forks source link

Missing discord-voice.c from Makefile in concord/src #186

Open Mentosz888 opened 3 weeks ago

Mentosz888 commented 3 weeks ago

I tried to use the discord_voice_join() function in my project, but at compilation I got a undefined refrence error to this function. From looking trough the src files, I realized the discord-voice.c is missing from the Makefile. Maybe I am unaware of some deprecation, but it seems to me, this is the only function that allows my bot to connect to a vc.

jdeokkim commented 3 weeks ago

Hello, have you tried using make voice when building this library?

Mentosz888 commented 3 weeks ago

Damn, you are absoluetly right. I have missed this rule entirely. Thanks!

Mentosz888 commented 2 weeks ago

Update on the situation, I got the voice to compile successfully. I've been looking at the internals of this project, and been testing the voice join and leave. For the usage of the discord_voice_shutdown() I extended the discord-voice.c file so I can get the vc by guild ID. There is an error in the gencodecs discord_update_voice_state_to_jsonb() function.

Without modification, currently it sends this JSON for a disconnect: {"op":4,"d":{"guild_id":"GUILD_ID","channel_id":"0","self_mute":false,"self_deaf":false}} And it should send this for a successfull disconnect: {"op":4,"d":{"guild_id":"GUILD_ID","channel_id":null,"self_mute":false,"self_deaf":false}}

ThePedroo commented 2 weeks ago

I must warn that Concord`s voice capabilities are extremely limited and audio sending / receiving is not yet implemented