Skip to content

Commit

Permalink
Add brief Attribute to BridgeSlashCommand (#1676)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Makiyu-py and pre-commit-ci[bot] committed Oct 7, 2022
1 parent ac824e7 commit b349337
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions discord/ext/bridge/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ 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")
self.brief = kwargs.pop("brief", None)
super().__init__(func, **kwargs)


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")
super().__init__(func, **kwargs)

async def transform(self, ctx: Context, param: inspect.Parameter) -> Any:
Expand Down Expand Up @@ -330,12 +329,12 @@ def command(self, *args, **kwargs):
def wrap(callback):
slash = self.slash_variant.command(
*args,
**filter_params(kwargs, brief="description"),
**kwargs,
cls=BridgeSlashCommand,
)(callback)
ext = self.ext_variant.command(
*args,
**filter_params(kwargs, description="brief"),
**kwargs,
cls=BridgeExtCommand,
)(callback)
command = BridgeCommand(
Expand Down

0 comments on commit b349337

Please sign in to comment.