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
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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