Repository: Pycord-Development/pycord

Issue:
Can't get the ID of a slash subcommand
### Summary

I use bot.get_application_command method to get the id of a slash commands to mention

### Reproduction Steps

I am currently making a custom help command for my bot which supports slash commands. I want to add mentioned slash commands in help embed for making it easy for users to use the command. `await bot.get_application_command("comm_name")` works absolutely fine on top level slash commands and returns `ApplicationCommand`.

But when i use a slash subcommand name like: "foo barr", It returns `None` even if the sub command is global. Tried adding `type=discord.SlashCommandGroup` parameter, but still no luck.

### Minimal Reproducible Code

```python
a = self.bot.get_application_command("parent subcommand", type=discord.SlashCommandGroup)
print(a)
```


### Expected Results

returns ApplicationCommand Object

### Actual Results

returns None

### Intents

member_content

### System Information

- Python v3.9.6-final
- py-cord v2.1.1-final
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000

### Checklist

- [X] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.

### Additional Context

_No response_


Discussion:
The ID is the same as the parent because subcommands behave like options in the API, but I get that get_command should also look for subcommands. Will add that.
Status Update please 
@Pycord-Development/maintainers 

Resolving patch:
diff --git a/discord/bot.py b/discord/bot.py
--- a/discord/bot.py
+++ b/discord/bot.py
@@ -179,7 +179,7 @@ def get_application_command(
         self,
         name: str,
         guild_ids: list[int] | None = None,
-        type: type[ApplicationCommand] = SlashCommand,
+        type: type[ApplicationCommand] = ApplicationCommand,
     ) -> ApplicationCommand | None:
         """Get a :class:`.ApplicationCommand` from the internal list
         of commands.
@@ -189,23 +189,39 @@ def get_application_command(
         Parameters
         ----------
         name: :class:`str`
-            The name of the command to get.
+            The qualified name of the command to get.
         guild_ids: List[:class:`int`]
             The guild ids associated to the command to get.
         type: Type[:class:`.ApplicationCommand`]
-            The type of the command to get. Defaults to :class:`.SlashCommand`.
+            The type of the command to get. Defaults to :class:`.ApplicationCommand`.
 
         Returns
         -------
         Optional[:class:`.ApplicationCommand`]
             The command that was requested. If not found, returns ``None``.
         """
-
-        for command in self._application_commands.values():
+        commands = self._application_commands.values()
+        for command in commands:
             if command.name == name and isinstance(command, type):
                 if guild_ids is not None and command.guild_ids != guild_ids:
                     return
                 return command
+            elif (names := name.split())[0] == command.name and isinstance(
+                command, SlashCommandGroup
+            ):
+                while len(names) > 1:
+                    command = get(commands, name=names.pop(0))
+                    if not isinstance(command, SlashCommandGroup) or (
+                        guild_ids is not None and command.guild_ids != guild_ids
+                    ):
+                        return
+                    commands = command.subcommands
+                command = get(commands, name=names.pop())
+                if not isinstance(command, type) or (
+                    guild_ids is not None and command.guild_ids != guild_ids
+                ):
+                    return
+                return command
 
     async def get_desynced_commands(
         self,


Test patch: