Skip to content

Add file type filtering in slash command attachment options and modal's fileupload component - #10494

Open
Soheab wants to merge 10 commits into
Rapptz:masterfrom
Soheab:feat/file-types
Open

Add file type filtering in slash command attachment options and modal's fileupload component#10494
Soheab wants to merge 10 commits into
Rapptz:masterfrom
Soheab:feat/file-types

Conversation

@Soheab

@Soheab Soheab commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds supports for the functionality to limit file uploads from a modal or slash commands to certain extensions.

Docs PR: discord/discord-api-docs#8506

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

Comment thread discord/app_commands/commands.py
Comment thread discord/app_commands/commands.py

@Rapptz Rapptz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not big on the decorator design that only applies to a single parameter type. Unfortunately the alternative design space for this one would stick out as well.

@Soheab

Soheab commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Not big on the decorator design that only applies to a single parameter type. Unfortunately the alternative design space for this one would stick out as well.

Yeah. An ext.commands like parameter() would've been better, but there is no such thing currently for slash commands.

@Soheab Soheab changed the title Add support for file types Add file type filtering in slash command attachment options and modal's fileupload component Aug 2, 2026
@Soheab
Soheab requested a review from vmphase August 7, 2026 21:10
Comment thread discord/enums.py
image = 'image'

@property
def file_extensions(self) -> Tuple[str, ...]:

@vmphase vmphase Aug 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not documented in docs/api.rst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants