Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.73k stars 2.3k forks source link

Consider mentioning case-sensitivity in error messages from Discord model converters #5174

Open RheingoldRiver opened 3 years ago

RheingoldRiver commented 3 years ago

What component of Red (cog, command, API) would you like to see improvements on?

error messages

Describe the enhancement you're suggesting.

Hi, I've mentioned in #3853 that it's a big UX issue that the role is not case insensitive. This issue also arises in other cogs/any command that uses a role.

I'd like to propose subclassing RoleNotFound from discord.py to mention the case-insensitivity, as that's the issue about 90% of the time when users see this error text. It could instead say:

Role {role} not found. Please note, roles are case-sensitive.

And this would be a much more useful error.

Thanks!

Anything else?

I'm not sure if this would be an appropriate change to suggest upstream to d.py or not? I haven't opened an issue there, since I think this is a Red thing that role inputs are case sensitive?? But I'm really not sure. Any thoughts on this?

Jackenmen commented 3 years ago

It seems like a nice UX improvement to me, I think it could potentially also be extended to other Discord model converters that are case-sensitive (especially users/members, perhaps also channel and guild converters). One point to raise here is that this would probably get included when someone uses a wrong ID as well which could be a bit confusing I guess? We could decide on checking whether the argument was a number though so perhaps it wouldn't be as much of an issue.

We'll see what others have to say.

// Note Implementation-wise we might decide to handle this differently (it's probably more likely that we would handle those errors in the global command error handler and send different error messages) but this can be talked about if this gets accepted.