Closed flav-code closed 1 year ago
well, I made the function to avoid duplicating coe but you can add an argument for when you need to disconnect the bot or set channel_id to null before calling the function.
I just dont really turn it to null before in a case you want to reconnect, but I guess that should be on developer's responsibility eh?
That's why I didn't put the function for disconnect, I only put it where it's the same.
Yeah, but I'm thinking if we should let the developer do that instead, after all I think anything outside the scope of lavalink & discord api should be in developer's responsibility, not our responsibility. I'll re-review once decided.
but what are you talking about
Reset every data in the connection class, before calling this.sendVoiceUpdate()
, so it's up to the developer's (user) responsibility to cache the existing data
so in disconnect you call the function and you want the user to delete the channel_id before calling the disconnect function?
so in disconnect you call the function and you want the user to delete the channel_id before calling the disconnect function?
Tldr:
this.channel_id = null;
this.deafened = false;
this.muted = false;
this.sendVoiceUpdate();
// ... rest of the code in disconnect
That's what I wanted to do... Is that all right with you? Shall I add it?
For now yeah, as I stated above.
Yeah, but I'm thinking if we should let the developer do that instead, after all I think anything outside the scope of lavalink & discord api should be in developer's responsibility, not our responsibility. I'll re-review once decided.
To keep things simple and concise
Okay, but this is just to make the code simpler and it won't change anything for the user.
probably kek, if they dont cache channel id and on closed event, they get the channelid from this class, then sure it will break, but then again, im passing the responsibility of caching this to them now
Oh okay, I get it, I'm actually using the Connection.channelId
lol
good
Minor improvement
Added Rest.getLavalinkInfo() and his type