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

Add brief Attribute to BridgeSlashCommand #1676

Merged
merged 4 commits into from Oct 7, 2022

Conversation

Makiyu-py
Copy link
Contributor

Summary

Fixes #1619.

When tackling the issue at hand, I found in the source code that in the bridged prefixed commands, it actually removes the value of the description and switches it over to the brief. And so if we add a brief in the command, the description would replace the brief to its value. (see lines)

class BridgeExtCommand(Command):
"""A subclass of :class:`.ext.commands.Command` that is used for bridge commands."""
def __init__(self, func, **kwargs):
kwargs = filter_params(kwargs, description="brief")

So it's either we remove briefs altogether in bridge commands or add briefs for bridged slash commands. I went for the latter.

I also saw in the source for bridged slash commands that apparently, if you have a brief in the command, it would mark it as a description instead? this would also cause problems if the user simply puts both a brief and description which further justifies why I chose the latter. (see lines)

class BridgeSlashCommand(SlashCommand):
"""A subclass of :class:`.SlashCommand` that is used for bridge commands."""
def __init__(self, func, **kwargs):
kwargs = filter_params(kwargs, brief="description")

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.

@Lulalaby Lulalaby added the hacktoberfest-accepted Hacktoberfest 2022 label Oct 7, 2022
@Lulalaby Lulalaby enabled auto-merge (squash) October 7, 2022 15:32
Copy link
Member

@BobDotCom BobDotCom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see you contributing again :)

@Lulalaby Lulalaby merged commit b349337 into Pycord-Development:master Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest 2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bridge command missing description
3 participants