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

Support specifying top-level aliases in the command and group decorator #91

Closed
wants to merge 2 commits into from
Closed

Support specifying top-level aliases in the command and group decorator #91

wants to merge 2 commits into from

Conversation

Shivansh-007
Copy link
Contributor

Overview

Reference taken from python-discord/bot#1124.

A new keyword argument has been added to the discord.ext.commands.GroupMixin.command (group) decorators. The kwarg root_aliases allows a sequence of alias names to be specified which are meant to act as top-level commands and groups. For example,

@github_group.command(name="issue", aliases=("pr",), root_aliases=("pr", "issue"))

Example

#Example for commands:
- `!gh issue 72` can also be called as `!issue 72`.
- `!gh src eval` can also be called as `!src eval`.

#Example for groups:
 - `!cmd gh issue 72` can also be called as `!gh issue 72`.
 - `!cmd src eval` can also be called as `!gh src eval`.

Did you:

  • If dependencies have been added or updated, run pipenv lock?
  • Lint your code (pipenv run lint)?
  • Set the PR to allow edits from contributors?

@vivekashok1221
Copy link
Member

Hello Shivansh, is this related to issue #85 ?

@Shivansh-007
Copy link
Contributor Author

Hello Shivansh, is this related to issue #85 ?

Yes sir.

@gustavwilliam
Copy link
Member

When you’re saying “reference taken”, what is that referring to? For example, have you copied any code?

While the MIT license allows you to do most things you want to, it also requires you to include the original license. I’d recommend reading the license for more info, and asking us if you’re unsure.

@Shivansh-007
Copy link
Contributor Author

By "reference taken", I mean that while writing the code, I had a look at their code and saw how they implemented it, hmm you can say the monkey patching for commands.command is 75% copied.

Would I need to add PyDis MIT license? or something else... am not sure.

@Shivansh-007
Copy link
Contributor Author

@gustavwilliam Bump :D

@Shivansh-007
Copy link
Contributor Author

Closing PR as I am not interested in contributing to the bot anymore, if anyone wants to take over you can open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants