Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment converter does not capture attachments for VAR_POSITIONAL parameters #9802

Open
3 tasks done
Zephyrkul opened this issue Apr 24, 2024 · 0 comments
Open
3 tasks done
Labels
unconfirmed bug A bug report that needs triaging

Comments

@Zephyrkul
Copy link
Contributor

Zephyrkul commented Apr 24, 2024

Summary

Attachment converter does not capture attachments for VAR_POSITIONAL parameters

Reproduction Steps

Create a command with a VAR_POSITIONAL (aka *args) parameter with the discord.Attachment typehint, then run it.

Minimal Reproducible Code

bot = commands.Bot(command_prefix=["--"], intents=discord.Intents.all())

@bot.command()
async def foo(ctx, *imgs: discord.Attachment):
    await ctx.send(ctx.message.attachments)
    await ctx.send(imgs)  # always shows an empty tuple no matter the state of .attachments

bot.run("<TOKEN>")

Expected Results

To receive a tuple of attached files in the parameter, OR for an error of some form to be raised to indicate that Attachment is an invalid converter type for VAR_POSITIONAL parameters

Actual Results

Parameter is accepted as valid by the command framework but is always an empty tuple

Intents

discord.Intents.all()

System Information

  • Python v3.12.2-final
  • discord.py v2.4.0-alpha
    • discord.py metadata: v2.4.0a5006+g8fd1fd80
  • aiohttp v3.9.5
  • system info: Windows 11 10.0.22621

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

Other parameter types, as well as commands.Greedy, still work as expected.

@Zephyrkul Zephyrkul added the unconfirmed bug A bug report that needs triaging label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

1 participant