Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DisposeOnDisconnect #18

Closed
FenikkusuKoneko opened this issue Sep 24, 2019 · 5 comments
Closed

Add DisposeOnDisconnect #18

FenikkusuKoneko opened this issue Sep 24, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@FenikkusuKoneko
Copy link

Add a DisposeOnDisconnect bool in LavalinkNodeOptions (or another name).
Reason: As I can see if someone disconnects the bot through Discord (by having the permission) the player gets disposed and removed from the players dictionary.
But, I already made my own method to check if the bot was disconnected forcefully, so I can send a message in the music output channel. I can dispose the player then manually. But the event from the library gets triggered first before mine.
Can you add this option and some checks in your VoiceStateUpdated event?

@angelobreuer
Copy link
Owner

You mean you do not know in which channel the player was before disconnecting because the player resets the voice channel? How about a "PlayerDisconnectEvent" which contains the voice channel the player disconnected from?

@FenikkusuKoneko
Copy link
Author

FenikkusuKoneko commented Sep 24, 2019

Yes, that would work too.
If the player gets disposed and removed then that event will help me to post some notifications that the player was disconnected.

@angelobreuer
Copy link
Owner

angelobreuer commented Sep 24, 2019

Okay, I've implemented the "PlayerDisconnected" and "PlayerConnected" (in f4de3f6) which both hold the voice channel identifier connected to/disconnected from. The "PlayerDisconnected" also holds a cause which indicates the reason why the player disconnected (see possible causes: PlayerDisconnectCause.cs).

@FenikkusuKoneko
Copy link
Author

Awesome, I can't wait to try it.

@angelobreuer
Copy link
Owner

👌 Package (v1.4.6) is publishing 😊 Thanks!

PR: #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants