gurkult / gurkbot

Our community bot, used for running the server.
MIT License
18 stars 16 forks source link

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

Closed Shivansh-007 closed 3 years ago

Shivansh-007 commented 3 years ago

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:

vivekashok1221 commented 3 years ago

Hello Shivansh, is this related to issue #85 ?

Shivansh-007 commented 3 years ago

Hello Shivansh, is this related to issue #85 ?

Yes sir.

gustavwilliam commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@gustavwilliam Bump :D

Shivansh-007 commented 3 years ago

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.