From d16d2d856f71b6a10e5aaf60d7f46cf2cf6b309d Mon Sep 17 00:00:00 2001 From: Chiggy-Playz <49774426+Chiggy-Playz@users.noreply.github.com> Date: Sun, 26 Sep 2021 11:13:23 +0530 Subject: [PATCH] Sort subcommand names (#68) --- discord/ext/commands/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 97609ac0..b6fb6954 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -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)], }