Registers another :class:`Command` with this group. If the name is not provided, the name of the command is used.
(self, cmd: Command, name: str | None = None)
| 1717 | return info_dict |
| 1718 | |
| 1719 | def add_command(self, cmd: Command, name: str | None = None) -> None: |
| 1720 | """Registers another :class:`Command` with this group. If the name |
| 1721 | is not provided, the name of the command is used. |
| 1722 | """ |
| 1723 | name = name or cmd.name |
| 1724 | if name is None: |
| 1725 | raise TypeError("Command has no name.") |
| 1726 | _check_nested_chain(self, name, cmd, register=True) |
| 1727 | self.commands[name] = cmd |
| 1728 | |
| 1729 | @t.overload |
| 1730 | def command(self, __func: t.Callable[..., t.Any]) -> Command: ... |