Skip to content

Implement name- and description_localizations in command subgroups #1469

@McJojo22

Description

@McJojo22

Summary

It adds name- and description_localizations to subgroups

What is the feature request for?

The core library

The Problem

You cannot use name- and description_localizations because the subgroup does not hand over the ** kwargs to the slash command group

The Ideal Solution

Add **kwargs to slash command subgroup and add it to the SubCommandGroup

The Current Solution

I added it myself and it worked...

Additional Context

Before:
` def create_subgroup(
self,
name: str,
description: Optional[str] = None,
guild_ids: Optional[List[int]] = None
) -> SlashCommandGroup:

    if self.parent is not None:
        # TODO: Improve this error message
        raise Exception("Subcommands can only be nested once")

    sub_command_group = SlashCommandGroup(name, description, guild_ids, parent=self)
    self.subcommands.append(sub_command_group)
    return sub_command_group`

After:
` def create_subgroup(
self,
name: str,
description: Optional[str] = None,
guild_ids: Optional[List[int]] = None,
**kwargs
) -> SlashCommandGroup:

    if self.parent is not None:
        # TODO: Improve this error message
        raise Exception("Subcommands can only be nested once")

    sub_command_group = SlashCommandGroup(name, description, guild_ids, parent=self, **kwargs)
    self.subcommands.append(sub_command_group)
    return sub_command_group`

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions