Greedy can mistake part of reason as a member in unmute #6236
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 project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#6236
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What Red version are you using?
3.5.4
Cog name
Mutes
Command name
mute,unmute, and other commands using aGreedyMemberconverterWhat did you expect to happen?
Only the intended member will be unmuted
What actually happened?
The intended member and another unrelated member gets unmuted
How can we reproduce this error?
Anything else?
This problem was discovered by the discord user codzombiestm. The original discussion in #support and extra context can be found here, note that their original usage of the unmute command with slashtags is not the root cause as confirmed by later examples of the command being used normally also manifesting this bug.
discord.ext.commands documentation states that greedy can be a footgun at times. Similar problems may be present elsewhere in the Mutes cog or the Red-Discordbot codebase.
It is impossible to both allow multiple members to be muted/unmuted and to allow a reason to be set in the same command, without either requiring explicit quotes around the reason or having the chance for username collisions. I don't believe there is a good solution to this problem, but I will leave the issue open for discussion.
A solution might be to have a setting where you can disable multiple mute/unmutes (only allowing single). Then the reason doesn't require quotes to avoid unintentional matches in large servers.
I'm not sure how feasible it is to have a setting like that, it would need to use a custom converter that hotswaps between two converters based on that setting. Not impossible, but definitely strange.
We could follow the existing strategy from the Mod cog - the
bancommand accepts a single member (that you can pass using anything that theMemberconverter accepts) and themassbancommand accepts multiple members that you can only pass using ID or a mention. In a similar fashion, we could split the mass-muting part ofmutecommand tomassmute.I agree with this. Correct me if I'm wrong, but I do not see mass unmuting being something used more commonly than a single user. Knowing this, priority should be placed on the unmuting of a single user being as accurate as possible.
Erledigt in
353238866. Behoben: Bei den (Un)Mute-Befehlen kann nur noch der erste Nutzer per Name angegeben werden, weitere nur per Erwähnung oder ID. Ein Wort aus der Begründung, das zufällig einem Mitgliedsnamen entspricht, wird damit nicht mehr als zusätzlicher Nutzer gelesen;[p]mute bob Grundfunktioniert weiterhin.Generated by Claude Code