[Mod] Voice checks #2296

Closed
opened 2018-11-12 22:22:37 +01:00 by Kowlin · 2 comments
Kowlin commented 2018-11-12 22:22:37 +01:00 (Migrated from github.com)

I'm talking about these checks, there are currently 2 issues with these checks.

The first issue is that these checks do not respect Permissions and will ignore allows or denies, since they do not use the core mod_or_permissions check for example.

The second issue is a bit more ingrained in the checks it self. As soon as these checks come across the first channel in a server that they do not have the permission to mute or deafen members. (for example lets take a channel override deny mute members) The entire check will fail and will return False, leaving the bot unable to actually use the command in that guild at all.

Affected commands:
mute voice
unmute voice
voiceban
voiceunban

I'm talking about [these checks](https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/develop/redbot/cogs/mod/checks.py), there are currently 2 issues with these checks. The first issue is that these checks **do not** respect Permissions and will ignore allows or denies, since they do not use the core ``mod_or_permissions`` check for example. The second issue is a bit more ingrained in the checks it self. As soon as these checks come across the first channel in a server that they do not have the permission to mute or deafen members. (for example lets take a channel override deny mute members) The entire check will fail and will return False, leaving the bot unable to actually use the command in that guild at all. Affected commands: ``mute voice`` ``unmute voice`` ``voiceban`` ``voiceunban``
mikeshardmind commented 2018-11-23 23:24:14 +01:00 (Migrated from github.com)

Not touching that without more discussion, since this would be a potentially breaking change to the RC.

I do agree that the check is currently problematic. Here's what I'd personally do:

  1. Remove the check from the commands that use it.
  2. Modify the 4 commands that use it to filter applicable channels by permissions bot has, rather than deny if missing on any channel, raising a failure if no channels targetted are allowed.
  3. Remove the check, or rename it to accurately describe it's behavior, since most checks behave on context, not on all perms individually resolved for each channel.

Additionally, these checks fail to prevent a 403 error in the case where the bot has the requested perms, but cannot connect to the voice channel, so they do not accomplish what they need to in their current form

Not touching that without more discussion, since this would be a potentially breaking change to the RC. I do agree that the check is currently problematic. Here's what I'd personally do: 1. Remove the check from the commands that use it. 2. Modify the 4 commands that use it to filter applicable channels by permissions bot has, rather than deny if missing on any channel, raising a failure if no channels targetted are allowed. 3. Remove the check, or rename it to accurately describe it's behavior, since most checks behave on context, not on all perms individually resolved for each channel. Additionally, these checks fail to prevent a 403 error in the case where the bot has the requested perms, but cannot connect to the voice channel, so they do not accomplish what they need to in their current form
Tobotimus commented 2019-01-10 01:36:01 +01:00 (Migrated from github.com)

Resolved by #2351.

Resolved by #2351.
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2296
No description provided.