Properly set root parent before copying a command's binding

This commit is contained in:
Rapptz
2022-03-15 03:15:07 -04:00
parent ca4db68686
commit 5bc085ebab
2 changed files with 4 additions and 4 deletions

View File

@ -757,8 +757,8 @@ class Group:
self._children: Dict[str, Union[Command, Group]] = {}
for child in self.__discord_app_commands_group_children__:
child = child._copy_with_binding(self) if not cls.__discord_app_commands_skip_init_binding__ else child
child.parent = self
child = child._copy_with_binding(self) if not cls.__discord_app_commands_skip_init_binding__ else child
self._children[child.name] = child
if child._attr and not cls.__discord_app_commands_skip_init_binding__:
setattr(self, child._attr, child)