Skip to content

Add AccessChannels permission to pre-join check

Created by: alexhorner

Summary

Fixes an issue with VoiceNext pre-connect permission checking.

Details

When VoiceNext tried to ConnectAsync, it would check it has UseVoice but not whether it has AccessChannels leading to a situation where it would try to connect to a channel which it has permission to speak in but not permission to access, causing ConnectAsync to deadlock, explained in notes.

Changes proposed

Add AccessChannels to the permission check on ConnectAsync.

Notes

When connecting to a voice channel, VoiceNext must check to see that it has permission to join the specified channel before proceeding.

If it did not do this check, it would wait on a join success message from Discord which would never arrive, deadlocking ConnectAsync because Discord is silly and did not provide an error response when you try to join a channel you do not have permission to join.

Previously, it only checked UseVoice meaning a lack of AccessChannels would cause this deadlocking behavious. This PR adds the check for AccessChannels.

Merge request reports

Loading