Closed
Description
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
- Create a slash command group in a cog
- Create a command in the group that has an attachment argument
- Run the command and attach a file
- 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.
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 Update README.rst #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
No response