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

Allow connection resumption on bot (re)start #113

Open
FelixMcFelix opened this issue Feb 13, 2022 · 0 comments
Open

Allow connection resumption on bot (re)start #113

FelixMcFelix opened this issue Feb 13, 2022 · 0 comments
Labels
feature-request Request for addition of a new feature or improvement. gateway Relates to the gateway feature (Discord's gateway integration). good first issue Good for newcomers help wanted Extra attention is needed

Comments

@FelixMcFelix
Copy link
Member

A discord user raised that automatically rejoining all calls on connection might be useful, i.e., in event of a bot crash or other failure needing a restart. This feature would be configurable, and disabled by default.

There was some discussion on Discord on how this could be done from 2022-01-24:

FelixMcFelix — 24/01/2022
in config.rs: add a new field, gated by #[cfg(feature = "gateway-core")]. Default to false? You should also add a setter method to Config.

in manager.rs: modify impl VoiceGatewayManager (server_update, state_update) to check this new field in the config. If new field is true, do a get_or_insert (rather than get)? You need to make the same change to Songbird::process for twilight.

What I'm unclear on is what discord actually send you when the bot comes back up: if they send you both voice_state_update and voice_server_update then you need to set call.connection to Some(...) before the calls to Call::update_server and Call::update_state. If not, then you can probably just call Call::join with the received channel id. 
you might need to do some of your own testing on that last part
Since Config is non-exhaustive, this should be good for the current branch
@FelixMcFelix FelixMcFelix added good first issue Good for newcomers help wanted Extra attention is needed gateway Relates to the gateway feature (Discord's gateway integration). feature-request Request for addition of a new feature or improvement. labels Feb 13, 2022
@FelixMcFelix FelixMcFelix added this to the vx.x.x (Aspirational) milestone Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for addition of a new feature or improvement. gateway Relates to the gateway feature (Discord's gateway integration). good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant