Sort subcommand names (#68)

This commit is contained in:
Chiggy-Playz 2021-09-26 11:13:23 +05:30 committed by GitHub
parent 456d71d228
commit d16d2d856f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1689,7 +1689,7 @@ class Group(GroupMixin[CogT], Command[CogT, P, T]):
"name": self.name,
"type": int(not (nested - 1)) + 1,
"description": self.short_doc or "no description",
"options": [cmd.to_application_command(nested=nested + 1) for cmd in self.commands],
"options": [cmd.to_application_command(nested=nested + 1) for cmd in sorted(self.commands, key=lambda x: x.name)],
}