Skip to content

Commit

Permalink
fix: SlashCommandGroup descriptions
Browse files Browse the repository at this point in the history
they're supposed to be optional but break when put into validation
  • Loading branch information
Middledot authored and Dorukyum committed Jul 31, 2022
1 parent ea4452e commit a8a4a29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def __new__(cls, *args, **kwargs) -> SlashCommand:
self.__original_kwargs__ = kwargs.copy()
return self

def __init__(self, func: Callable, *args, **kwargs) -> None:
def __init__(self, func: Callable, **kwargs) -> None:
super().__init__(func, **kwargs)
if not asyncio.iscoroutinefunction(func):
raise TypeError("Callback must be a coroutine.")
Expand Down Expand Up @@ -1016,10 +1016,10 @@ def __init__(
parent: Optional[SlashCommandGroup] = None,
**kwargs,
) -> None:
validate_chat_input_name(name)
validate_chat_input_description(description)
self.name = str(name)
self.description = description
self.name = name
self.description = description or "No description provided"
validate_chat_input_name(self.name)
validate_chat_input_description(self.description)
self.input_type = SlashCommandOptionType.sub_command_group
self.subcommands: List[Union[SlashCommand, SlashCommandGroup]] = self.__initial_commands__
self.guild_ids = guild_ids
Expand Down

0 comments on commit a8a4a29

Please sign in to comment.