Skip to content

Commit

Permalink
fix(ext.bridge): fix groups missing parent attr (#1823)
Browse files Browse the repository at this point in the history
* fix(ext.bridge): fix groups missing parent attr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore(changelog): add changelog entry

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lala Sabathil <lala@pycord.dev>
  • Loading branch information
3 people committed Dec 14, 2022
1 parent 5576d32 commit 647f00f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Expand Up @@ -16,11 +16,18 @@ _No changes yet_

### Fixed

- Fixed bridge groups missing the `parent` attribute.
([#1823](https://github.com/Pycord-Development/pycord/pull/1823))

## [2.3.2] - 2022-12-03

### Fixed

- Fixed another `AttributeError` relating to the new `bridge_commands` attribute on
`ext.bridge.Bot`. ([#1815](https://github.com/Pycord-Development/pycord/pull/1815))
- Fixed an `AttributeError` in select relating to the select type.
([#1814](https://github.com/Pycord-Development/pycord/pull/1814))
- Fix `Thread.applied_tags` always returning an empty list.
- Fixed `Thread.applied_tags` always returning an empty list.
([#1817](https://github.com/Pycord-Development/pycord/pull/1817))

## [2.3.1] - 2022-11-27
Expand Down
13 changes: 9 additions & 4 deletions discord/ext/bridge/core.py
Expand Up @@ -311,12 +311,17 @@ class BridgeCommandGroup(BridgeCommand):
If :func:`map_to` is used, the mapped slash command.
"""

ext_variant: BridgeExtGroup
slash_variant: BridgeSlashGroup

def __init__(self, callback, *args, **kwargs):
self.ext_variant: BridgeExtGroup = BridgeExtGroup(callback, *args, **kwargs)
name = kwargs.pop("name", self.ext_variant.name)
self.slash_variant: BridgeSlashGroup = BridgeSlashGroup(
callback, name, *args, **kwargs
super().__init__(
callback,
ext_variant=(ext_var := BridgeExtGroup(callback, *args, **kwargs)),
slash_variant=BridgeSlashGroup(callback, ext_var.name, *args, **kwargs),
parent=kwargs.pop("parent", None),
)

self.subcommands: list[BridgeCommand] = []

self.mapped: SlashCommand | None = None
Expand Down

0 comments on commit 647f00f

Please sign in to comment.