Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add aliases to built in commands #1370

Open
neomoth opened this issue Aug 8, 2022 · 5 comments
Open

Ability to add aliases to built in commands #1370

neomoth opened this issue Aug 8, 2022 · 5 comments
Labels
commands-next For issues related to DSharpPlus.CommandsNext enhancement
Milestone

Comments

@neomoth
Copy link

neomoth commented Aug 8, 2022

I'm personally unhappy with the built-in help command in that I can't use h as an alias for it. I know its a small issue and I could just type out the full word help, but to me its a bit irritating, and I'd like to have an option to either make h an alias for it (or anything you want as an alias) or to be able to easily remove the help command and add my own custom one. (the formatter doesn't help because that won't fix the alias issue)

@akiraveliara
Copy link
Contributor

You actually can disable the default help command, see here: https://github.com/DSharpPlus/DSharpPlus/blob/master/DSharpPlus.CommandsNext/CommandsNextConfiguration.cs#L87 - just as a side note. I'll leave the question of an alias open for discussion.

@akiraveliara akiraveliara added enhancement commands-next For issues related to DSharpPlus.CommandsNext v4.x labels Aug 8, 2022
@neomoth
Copy link
Author

neomoth commented Aug 8, 2022

Oh, alright. Thanks for pointing that out!

@OoLunar OoLunar changed the title [Feature] Ability to remove help command or at least make so "h" is an alias of the built-in help command Ability to add aliases to built in commands Feb 28, 2023
@OoLunar
Copy link
Member

OoLunar commented Feb 28, 2023

I'm unsure on how we would go about this. Adding aliases through the CommandNextConfiguration class seems obvious, however by default we reference the AliasAttribute when iterating through the commands iirc

@ProfDoof
Copy link
Contributor

We could just add it as a builder type method AddAlias that maps an alias to a command or a command to an alias. Your choice. (Probably simpler to go from alias to command.) It could probably just be a direct "if this alias is in our map, replace it". You could also add it to command handler as a method so that people can register their handlers directly and the handler has the ability to add aliases. I can't think of anything else off the top of my head though.

@OoLunar
Copy link
Member

OoLunar commented Feb 28, 2023

This is plenty to go off of, thank you Professor o7

@akiraveliara akiraveliara removed the v4.x label Oct 5, 2023
@akiraveliara akiraveliara added this to the Backlog milestone Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commands-next For issues related to DSharpPlus.CommandsNext enhancement
Projects
None yet
Development

No branches or pull requests

4 participants