[V3 Mod] Make mute server use a role #1852

Closed
opened 2018-06-11 13:22:12 +02:00 by laggron42 · 5 comments
laggron42 commented 2018-06-11 13:22:12 +02:00 (Migrated from github.com)

Feature request

Select the type of feature you are requesting:

  • Cog
  • Command
  • API functionality

Describe your requested feature

The [p]mute server edit every channel permissions. This requires a lot of API calls and is really slow to operate (it takes about 6 seconds for 10 channels, so imagine on huge servers) and we could reduce that time by muting using a role instead of editing the channel permissions.

This should be optional so users can decide what they want between a fast server mute with a role or a slow mute with channel perms.

# Feature request <!-- This template is for feature requests. Please fill out the following: --> #### Select the type of feature you are requesting: <!-- To check a box, replace the space between the [] with a x --> - [ ] Cog - [x] Command - [ ] API functionality #### Describe your requested feature <!-- Feel free to describe in as much detail as you wish. If you are requesting a cog to be included in core: - Describe the functionality in as much detail as possible - Include the command structure, if possible - Please note that unless it's something that should be core functionality, we reserve the right to reject your suggestion and point you to our cog board to request it for a third-party cog If you are requesting a command: - Include what cog it should be in and a name for the command - Describe the intended functionality for the command - Note any restrictions on who can use the command or where it can be used If you are requesting API functionality: - Describe what it should do - Note whether it is to extend existing functionality or introduce new functionality --> The `[p]mute server` edit every channel permissions. This requires a lot of API calls and is really slow to operate (it takes about 6 seconds for 10 channels, so imagine on huge servers) and we could reduce that time by muting using a role instead of editing the channel permissions. This should be optional so users can decide what they want between a fast server mute with a role or a slow mute with channel perms.
Tobotimus commented 2018-08-01 03:49:10 +02:00 (Migrated from github.com)

This is a well presented suggestion, it has a few issues though. I agree that the current [p]mute server command is too API spammy. However applying a role instead is a change in behaviour, so this could be a separate command (cough punish cough). One use of [p]mute server is to quickly restrict a user to a small number of channels by doing [p]mute server followed by [p]unmute channel, because doing [p]mute channel in every other channel would take a long time. Applying a muted role to a person changes the behaviour in that [p]unmute channel wouldn't do anything to someone who is server-muted.

An alternate approach might be to allow roles to be muted the same way users can, then mods can just apply a muted role. This avoids changing the behaviour of [p]mute but doesn't solve the API spammy nature of the command itself. I'm open to more discussion :)

This is a well presented suggestion, it has a few issues though. I agree that the current `[p]mute server` command is too API spammy. However applying a role instead is a change in behaviour, so this could be a separate command (*cough punish cough*). One use of `[p]mute server` is to quickly restrict a user to a small number of channels by doing `[p]mute server` followed by `[p]unmute channel`, because doing `[p]mute channel` in every other channel would take a long time. Applying a muted role to a person changes the behaviour in that `[p]unmute channel` wouldn't do anything to someone who is server-muted. An alternate approach might be to allow roles to be muted the same way users can, then mods can just apply a muted role. This avoids changing the behaviour of `[p]mute` but doesn't solve the API spammy nature of the command itself. I'm open to more discussion :)
laggron42 commented 2018-08-01 11:17:49 +02:00 (Migrated from github.com)

Maybe we could still use a role for guild mute and, when using channel unmute, force the send_messages permissions in the channel (ignore role perms)? But another issue would be to remove that forced permission, but when...

I already started working on that feature, you can check the mute branch of my fork (the work currently done ignores what you suggested, but I will look after it).

Another addition not specified in the issue is that, when using mute without subcommands, it will be default to a guild mute (my moderators were lost because they were just trying to [p]mute @someone)

Maybe we could still use a role for guild mute and, when using channel unmute, force the `send_messages` permissions in the channel (ignore role perms)? But another issue would be to remove that forced permission, but when... I already started working on that feature, you can check the `mute` branch of my fork (the work currently done ignores what you suggested, but I will look after it). Another addition not specified in the issue is that, when using `mute` without subcommands, it will be default to a guild mute (my moderators were lost because they were just trying to `[p]mute @someone`)
calebj commented 2018-08-01 13:09:34 +02:00 (Migrated from github.com)

I had an idea for solving this problem in v2 punish that I'll try to implement and test today. Will comment with how it goes.

I had an idea for solving this problem in v2 punish that I'll try to implement and test today. Will comment with how it goes.
mikeshardmind commented 2018-08-02 14:49:38 +02:00 (Migrated from github.com)

This cannot be reliably done with a role without a server's permissions being designed for this usage.

If this makes it into core, it needs to error in cases it would be ineffective with a clear reason why presented to the user.

Discord's developer docs on permissions explain this, but not really in good user-facing terms. If a user has any role allowing something (other than the default role), any role-based denies won't matter since non-default role allows are batch applied after batch applying non-default role denies.

This ends up making it so that channels which are invisible to most, visible but mute to role B and non-mute to role C can't be effectively muted without also revoking read permissions without assigning permissions granularly, and ensuring members of C are also members of B.

It gets significantly more convoluted with more restricted channels.

I'm of the opinion it's worth supporting, but given the various caveats for it, it needs to be opt-in, with well-documented reasons as to why, and how to properly configure it, and warn users if it isn't going to work on someone they attempt to mute with it.

This *cannot* be reliably done with a role without a server's permissions being designed for this usage. If this makes it into core, it needs to error in cases it would be ineffective with a clear reason why presented to the user. Discord's developer docs on permissions explain this, but not really in good user-facing terms. If a user has any role allowing something (other than the default role), any role-based denies won't matter since non-default role allows are batch applied *after* batch applying non-default role denies. This ends up making it so that channels which are invisible to most, visible but mute to role B and non-mute to role C can't be effectively muted without also revoking read permissions without assigning permissions granularly, and ensuring members of C are also members of B. It gets significantly more convoluted with more restricted channels. I'm of the opinion it's worth supporting, but given the various caveats for it, it needs to be opt-in, with well-documented reasons as to why, and how to properly configure it, and warn users if it isn't going to work on someone they attempt to mute with it.
mikeshardmind commented 2020-01-04 08:29:22 +01:00 (Migrated from github.com)

replaced by #3270

replaced by #3270
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#1852
No description provided.