[Mutes] Catch failure to add or remove role #5467

Manually merged
Jan200101 merged 0 commits from Jan200101/PR/mute-check into V3/develop 2026-11-21 16:09:34 +01:00
Jan200101 commented 2021-12-14 14:52:37 +01:00 (Migrated from github.com)

Closes #5161
Alternative of #5345

Description of the changes

catches discord.errors.HTTPException thrown by add_roles and remove_roles and states the user is already (un)muted

Closes #5161 Alternative of #5345 ### Description of the changes catches `discord.errors.HTTPException` thrown by add_roles and remove_roles and states the user is already (un)muted
Jan200101 (Migrated from github.com) reviewed 2021-12-14 14:54:17 +01:00
Jan200101 (Migrated from github.com) commented 2021-12-14 14:54:17 +01:00

it might be worth adding the guild.muted_users.set here to ensure the user is part of the stored _server_mutes

it might be worth adding the guild.muted_users.set here to ensure the user is part of the stored _server_mutes
Jan200101 (Migrated from github.com) reviewed 2021-12-14 14:54:58 +01:00
Jan200101 (Migrated from github.com) commented 2021-12-14 14:54:58 +01:00

if statement changed to match the one in mute_user

if statement changed to match the one in `mute_user`
TrustyJAID (Migrated from github.com) reviewed 2021-12-14 19:45:48 +01:00
TrustyJAID (Migrated from github.com) commented 2021-12-14 19:45:48 +01:00

As Jack stated in #5161 we should care more about [p]unmute not so much [p]mute. This would prevent updating a mute duration forcing the user to unmute and then re-apply the mute which is inconvenient.

As Jack stated in #5161 we should care more about `[p]unmute` not so much `[p]mute`. This would prevent updating a mute duration forcing the user to unmute and then re-apply the mute which is inconvenient.
Jan200101 (Migrated from github.com) reviewed 2021-12-14 19:58:33 +01:00
Jan200101 (Migrated from github.com) commented 2021-12-14 19:58:33 +01:00

you make a good point.

add_roles won't fail if the user already has the role and since the user is already muted the user gets what they expected.

It might be worthwhile to add a message for updating the mute duration and printing out already muted if none is given, but this is not the point of this PR

you make a good point. add_roles won't fail if the user already has the role and since the user is already muted the user gets what they expected. It might be worthwhile to add a message for updating the mute duration and printing out already muted if none is given, but this is not the point of this PR
Jan200101 (Migrated from github.com) reviewed 2021-12-14 20:03:54 +01:00
Jan200101 (Migrated from github.com) commented 2021-12-14 20:03:54 +01:00

Here is something along the lines of what I mean (keeping the already existing text)
image

Here is something along the lines of what I mean (keeping the already existing text) ![image](https://user-images.githubusercontent.com/15076013/146062879-a32597c3-515b-456f-aa5d-7e72417f9465.png)
Mrcoolgamer11 manually merged commit 7e9446ba4c into V3/develop 2026-11-21 16:09:34 +01:00
Sign in to join this conversation.
No reviewers
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!5467
No description provided.