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

fix(ext.bridge): fix groups missing parent attr #1823

Merged
merged 6 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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