Cog-Creators / Cog-Creators/Red-DiscordBot

Greedy can mistake part of reason as a member in `unmute`

Open
#6,236 5 comments 0 reactions 0 assignees View on GitHub
Category: Cogs - Mutes Status: Needs Discussion Type: Bug
Dominant language
Python
Stars
5.7k
Forks
2.5k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

### What Red version are you using?

3.5.4

### Cog name

Mutes

### Command name

`mute`, `unmute`, and other commands using a `Greedy` `Member` converter

### What 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?

1. Ensure the mutes cog is loaded
2. Ensure you have the privileges to mute and unmute members
3. Mute a member
4. Unmute the said member with a reason that partially resembles the name of another member who isn't intentionally being unmuted

### Anything else?

This problem was discovered by the discord user **codzombiestm**. The original discussion in #support and extra context can be found [here](https://discord.com/channels/133049272517001216/387398816317440000/1140430435499909140), 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](https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#greedy) states that greedy can be a footgun at times. Similar problems may be present elsewhere in the Mutes cog or the Red-Discordbot codebase.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.