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

[V3 Alias] Parameterized and fixed-argument command aliases #2011

Open
1 task done
calebj opened this issue Aug 13, 2018 · 7 comments
Open
1 task done

[V3 Alias] Parameterized and fixed-argument command aliases #2011

calebj opened this issue Aug 13, 2018 · 7 comments
Labels
Category: Cogs - Alias This is related to the Alias cog. Status: Needs Discussion Needs more discussion. Type: Feature New feature or request.

Comments

@calebj
Copy link
Member

calebj commented Aug 13, 2018

Feature request

Select the type of feature you are requesting:

  • Command

Describe your requested feature

I've been in the situation where I or other users want to create shortcuts for long commands with parameters in the middle of those commands, instead of at the end. On the other hand, I've also wanted to prevent any parameters from being added to the end of the aliased command. The Alias cog is the right place to add both.

I wouldn't mind doing this, but it should be fairly simple to put together. I also don't want to start another thing unless it's wanted in core.

What it would probably involve:

  • Switch to using discord.py's view machinery for argument parsing parity
  • Add syntax for designating defaults or required arguments to aliases
  • More things I haven't thought of yet

Update
At the current moment, it seems as though some of what was requested by this issue has been addressed in #2455. However, Alias still does not support adding defaults to custom parameters.

@Tobotimus Tobotimus added V3 Type: Feature New feature or request. labels Aug 13, 2018
@Tobotimus
Copy link
Member

I like the suggestion, I've always wanted to write this cog, and have never got around to it. However, I want us to be careful, since as it stands alias is quite a simple cog and I'd like to keep it that way on the front-end - adding these extra features should aim to avoid overwhelming the user with lots of options. Perhaps adding an extra [p]advalias (short for advanced alias) will help to separate the two, so the simplicity of the [p]alias command is retained?

@calebj
Copy link
Member Author

calebj commented Aug 13, 2018

Though it would have to have a per-alias toggle to prevent potentially changing behavior on old aliases, I'm opposed in principle to mixing command groups and normal commands. I would keep it under [p]alias but keep the idea by making it a subcommand named advanced that toggles the aforementioned setting. An example of this kind of convention is trigger's regex toggle.

Perhaps a toggle is all that would be needed, if the syntax can be self-describing. Consider:

!aliased {0:foo} "{*2:baz=default value 2}" {1:bar=default value 1}

The first alias parameter is required, since it has no default. The second alias parameter (bar) will be placed last in the substitution, but will be without quotes to allow a *consume_rest mode of operation. And the third alias parameter (baz) will be placed in quotes, but will do its own *consume_rest due to the asterisk on it. Both default values contain spaces. Not everyone will use these modes of operation, of course, but they're fairly close to the way you'd write the command in Python.

@Tobotimus Tobotimus added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this labels Feb 20, 2019
@Tobotimus Tobotimus added this to the 3.1 Sprint 2 milestone Feb 27, 2019
@Tobotimus Tobotimus removed the V3 label Jun 29, 2019
@Flame442 Flame442 removed this from the 3.1 Sprint 2 milestone Sep 27, 2019
@Flame442 Flame442 removed the Status: In Progress There's a PR open to deal with this, or an org member is working on this internally label Sep 27, 2019
@mikeshardmind
Copy link
Contributor

wew, this one fell threw the cracks. Merged a long time ago

@mikeshardmind
Copy link
Contributor

Or I can misread this, sorry that was CC which fully handles this already.

@Zephyrkul
Copy link
Contributor

Didn't #2455 add this functionality?

@mikeshardmind
Copy link
Contributor

I thought that didn't handle default values for alias, but I'm not the largest alias user, did I miss something with that?

@Zephyrkul
Copy link
Contributor

Ah, sorry, no it doesn't. I didn't see that comment further down. Worth noting that CC doesn't handle default arguments either.

@Jackenmen Jackenmen added Category: Cogs - Alias This is related to the Alias cog. Status: Accepted We want this labels Jan 16, 2020
@Jackenmen Jackenmen added Status: Needs Discussion Needs more discussion. and removed Status: Accepted We want this labels Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Alias This is related to the Alias cog. Status: Needs Discussion Needs more discussion. Type: Feature New feature or request.
Projects
None yet
Development

No branches or pull requests

6 participants