[V2] Audio voice fix for channels with user limit #1922
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!1922
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-for-1643"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bugfix request
Describe the bug being fixed
When the bot is idle in full channel with user limit, when you were trying to play music with command
[p]play (name of song), it was saying "Your voice channel is full."Fixes #1643
Anything we need to know about this fix?
No, all I did was just adding one if (well changing place of it technically). You used such solution in another function already even, it looks like you forgot to do this here as well.
I think it makes sense to either modify
has_connect_permsto account for the case of already being in the channel with voice perms (As an admin even join after the bot surpassing the channel limit, making calculating an offest wrong too)or to modify handling of
and handle it there.
I've detailed why the current proposed solution is not quite enough in comments attached.
@ -1514,0 +1509,4 @@except ChannelUserLimit:await self.bot.say("Your voice channel is full.")returnelse:This is not the correct condition, or at least not without additional conditions, as the else condition prior existing that you left in place would also pass this condition.
@ -1514,2 +1512,4 @@else:await self._join_voice_channel(voice_channel)else: # We are connected but not to the right channelif self.voice_client(server).channel != voice_channel:This line right here (well, specifically the full channel comparison in the function call (
github.com/Cog-Creators/Red-DiscordBot@97b70c35ee/cogs/audio.py (L2246)) is the root cause of the issue, as there is no offset if the bot is in the channel, nor an additional pass condition of the bot is in the channel already with speak perms.Having the else block handled like this means the above permission checking never gets called if you want to bot to switch channels.
You're right, though I didn't change what was already there. I just changed place of the code - try clause is now in if, like in other places of this code.
Of course this can be fixed in another pull request, I don't think I should do changes not relevant to the issue I mentioned.
I can try to help with that though, because you're right, that this should check for connecting perms in else clause as well.
Pull request closed