Repository: Pycord-Development/pycord

Issue:
Argument parsing for attachment options not working in slash command groups in cogs
### Summary

I get an error when running a command which has an attachment option. This only happens in slash group commands and does not happen for regular slash commands. This happens on the latest commit.

### Reproduction Steps

1. Create a slash command group in a cog
2. Create a command in the group that has an attachment argument
3. Run the command and attach a file
4. You'll get the following error:

```
Ignoring exception in on_interaction
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/discord/commands/core.py", line 110, in wrapped
    ret = await coro(arg)
  File "/opt/venv/lib/python3.10/site-packages/discord/commands/core.py", line 756, in _invoke
    _data = ctx.interaction.data["resolved"]["attachments"][arg]
KeyError: 'resolved'
```

### Minimal Reproducible Code

Basically the example provided by the repository but in a slash command group.

```python
    tags = discord.SlashCommandGroup("tags", "Interact with tags", guild_ids=[12345])

    @tags.command(description="Add a new tag")
    async def add(self, ctx, name: Option(str, description="Name of the tag to add"), image: Option(discord.Attachment, description="Image to attach", required=False)) -> None:
        file = await image.to_file()
        await ctx.respond("Here's your file!", file=file)
```


### Expected Results

Arguments parse correctly and the bot responds with whatever file was attached

### Actual Results

The error I showed above is thrown.

### Intents

Default + members + messages + presences

### System Information

- Python v3.10.0-final
- py-cord v2.0.0-beta
    - py-cord pkg_resources: v2.0.0b4
- aiohttp v3.7.4.post0
- system info: Linux 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021

### 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:
I found the offending line:
https://github.com/Pycord-Development/pycord/blob/master/discord/commands/core.py#L1028

Changing this to something like this seems to fix it, but I'm not sure if this would have any unintended side effects or anything like that.

```py
    async def _invoke(self, ctx: ApplicationContext) -> None:
        resolved = ctx.interaction.data["resolved"]
        option = ctx.interaction.data["options"][0]
        command = find(lambda x: x.name == option["name"], self.subcommands)
        ctx.interaction.data = option
        ctx.interaction.data["resolved"] = resolved
        await command.invoke(ctx)
```



Resolving patch:
diff --git a/discord/commands/core.py b/discord/commands/core.py
--- a/discord/commands/core.py
+++ b/discord/commands/core.py
@@ -1063,7 +1063,9 @@ def inner(cls: Type[SlashCommandGroup]) -> SlashCommandGroup:
 
     async def _invoke(self, ctx: ApplicationContext) -> None:
         option = ctx.interaction.data["options"][0]
+        resolved = ctx.interaction.data.get("resolved", None)
         command = find(lambda x: x.name == option["name"], self.subcommands)
+        option["resolved"] = resolved
         ctx.interaction.data = option
         await command.invoke(ctx)
 


Test patch: