Make selfrole case insensitive #3853
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#3853
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?
Feature request
Select the type of feature you are requesting:
Describe your requested feature
In Admin cog, could selfrole be made case insensitive? In the event that a server has two separate roles that are both allowed in selfrole, it could print a warning about the situation every time a role is added or removed via selfrole.
I think it is more appropriate to be explicit here when performind moredation actions ( giving a role) to members. but this is just my personal opinion.
my users are unable to figure out how to assign themselves roles because it's case-sensitive. I realize how ridiculous that sounds, but it's a huge usability problem in my server. I suppose I could just make all role names lowercase, but that makes my server look lazy/sloppily set-up, and it's supposed to be an official support server.
Maybe case sensitivity could be toggled?
I think this wouldn't be a bad idea, assuming only
[p]selfrole add/removewould be affected and you would still have to use proper casing when adding/removing role from available selfroles with[p]selfroleset. Once role is added with[p]selfroleset, its ID is saved in config so users would have the proper role assigned no matter the casing that they used.I'm marking this as "Needs discussion" until another org member gives their opinion
If I may chip in, what happens if the role "James" and "james" are both set to self-assignable and a user runs
[p]selfrole add jamesIn that case I would add james and print a warning along with the confirmation - "Added role
james. Please note that the role[s]James[, and JameS] is[are] also available. You may use^selfrole removeand^selfrole addif needed." or something along those linesIf there are multiple casings available and you try to assign one that doesn't match any of them, it could either error or guess and print a similar warning. I think this is enough of an edge case (and already a terrible practice haha) that it's not a big tradeoff to somewhat sacrifice ease of use in this case.
In that case I would say it would be best to check role.name.lower() and don't allow 2 roles with a similar name with just different casing to be made self-assignable at the same time.
ah yeah, that probably makes more sense
I'm not sure quite how that would work since role names can be changed...
You can technically break this right now if you have two roles with the exact same (case sensitive) name. It will only allow you to assign one of them, saying the role was already assigned if you have one of the two. You are able to use the ID, but must users won't know to do that.
We could ... do a menu picker for when a prompt matches multiple roles, in the realworld chances are that this won't be the case much, but outside of straight up saying "unable to give you role, currently multiple roles share this name" can't think of anything else we could do
well it could give you the role you exact-matched if you did, and if not then say "sorry unable to determine"
If
Jamesandjamesexist ->