3 Commits

Author SHA1 Message Date
Rapptz
f4c5d37c8f [commands] Rework Cog + Group inheritance to requite GroupCog
This is an attempt to fix the MRO issues present in the current
implementation. The previous implementation of using both Cog and
app_commands.Group in the inheritance chain caused issues with things
such as walk_commands due to it potentially shadowing the app_commands
version of the call.

In this particular case it's better to use composition instead of
inheritance to avoid these bugs entirely. Especially as more things are
added that could conflict with each other.
2022-05-01 14:01:21 -04:00
Rapptz
25ad5b675c Ensure explicitly set parents on nested groups are respected
This had a multiple layer bug that needed to be squashed. The first
issue was that setting `parent=...` inside a `Group` wouldn't actually
add the `Group` into the `parent` children mapping. This meant that
it didn't actually end up copying the children when it came time to
within e.g. a Cog.

The second issue was that even if it was added into the children
listing, it wouldn't properly set the attribute.

This commit fixes both of these issues.

Fix #7818
2022-04-01 09:13:27 -04:00
Bryan Forbes
0a8065606a
Update parent reference of Group children 2022-03-30 19:12:39 -04:00