Add hidden_aliases option for commands decorator #4899

Closed
opened 2021-03-19 05:14:46 +01:00 by RheingoldRiver · 4 comments
RheingoldRiver commented 2021-03-19 05:14:46 +01:00 (Migrated from github.com)

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

API

Describe the enhancement you're suggesting.

Sometimes, we have a lot of aliases of a command in case someone forgets if it ends in an s or not, or how to spell something, etc. But it super clutters up the help to print every single alias. I would like to propose the following modification to the @commands.command decorator:

@commands.command(aliases=['awakenings'], hidden_aliases=['awakening', 'awakening_help', 'awake_help', 'awoken_help', 'awokens_help'])

The hidden aliases would function identically to aliases but NOT be printed in the command documentation.

### What component of Red (cog, command, API) would you like to see improvements on? API ### Describe the enhancement you're suggesting. Sometimes, we have a lot of aliases of a command in case someone forgets if it ends in an `s` or not, or how to spell something, etc. But it super clutters up the help to print every single alias. I would like to propose the following modification to the `@commands.command` decorator: ```python @commands.command(aliases=['awakenings'], hidden_aliases=['awakening', 'awakening_help', 'awake_help', 'awoken_help', 'awokens_help']) ``` The hidden aliases would function identically to aliases but NOT be printed in the command documentation.
Flame442 commented 2021-03-19 05:19:32 +01:00 (Migrated from github.com)

As a potential workaround, you can disable [p]helpset showaliases if you don't want help to be cluttered, but this will prevent any aliases from being shown.

As a potential workaround, you can disable `[p]helpset showaliases` if you don't want help to be cluttered, but this will prevent any aliases from being shown.
RheingoldRiver commented 2021-03-19 05:23:13 +01:00 (Migrated from github.com)

Oh, thanks so much! That's a huge improvement for us! We had been deleting a lot of our aliases to de-clutter this screen, but instead we'll just disable (at least for now)! I'll still leave this issue open, since being able to choose a few aliases to show would be wonderful, but that helps us a ton!

Oh, thanks so much! That's a huge improvement for us! We had been deleting a lot of our aliases to de-clutter this screen, but instead we'll just disable (at least for now)! I'll still leave this issue open, since being able to choose a few aliases to show would be wonderful, but that helps us a ton!
Kreusada commented 2025-03-28 02:37:22 +01:00 (Migrated from github.com)

I don't feel that this feature would be beneficial enough to justify supporting in core. Most aliases within the core and cog ecosystem are minimal and don’t significantly clutter the screen, though I can understand your concern. As Flame said, the p]helpset showaliases would be appropriate, and I'm glad it helped you out. This seems more like an issue for commands that generate multiple aliases in the fashion of your example. In this case, there are other options available such as forking (if appropriate) or using a custom help formatter and catering for specific situations. That said, this falls outside the intended scope, and I don't believe its worth supporting this in core.

I don't feel that this feature would be beneficial enough to justify supporting in core. Most aliases within the core and cog ecosystem are minimal and don’t significantly clutter the screen, though I can understand your concern. As Flame said, the `p]helpset showaliases` would be appropriate, and I'm glad it helped you out. This seems more like an issue for commands that generate multiple aliases in the fashion of your example. In this case, there are other options available such as forking (if appropriate) or using a custom help formatter and catering for specific situations. That said, this falls outside the intended scope, and I don't believe its worth supporting this in core.
Owner

Offene Diskussion bzw. Feature-Wunsch mit geringem Nutzen im Verhältnis zum Aufwand (oder Nischenfall), der seit Langem ohne Ergebnis offen ist. Ich schließe das Issue; bei konkretem Bedarf kann es gern wieder geöffnet werden.


Generated by Claude Code

Offene Diskussion bzw. Feature-Wunsch mit geringem Nutzen im Verhältnis zum Aufwand (oder Nischenfall), der seit Langem ohne Ergebnis offen ist. Ich schließe das Issue; bei konkretem Bedarf kann es gern wieder geöffnet werden. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
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
2 participants
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#4899
No description provided.