Skip to content

feat: File type filtering for Attachment options and FileUpload component - #3284

Open
NeloBlivion wants to merge 9 commits into
Pycord-Development:masterfrom
NeloBlivion:filetype
Open

feat: File type filtering for Attachment options and FileUpload component#3284
NeloBlivion wants to merge 9 commits into
Pycord-Development:masterfrom
NeloBlivion:filetype

Conversation

@NeloBlivion

Copy link
Copy Markdown
Member

Summary

Support file_types in Option and FileUpload.

Information

  • 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, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@NeloBlivion
NeloBlivion requested review from a team and Paillat-dev June 23, 2026 04:23
@NeloBlivion
NeloBlivion requested a review from Lulalaby June 23, 2026 04:24
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Jun 23, 2026
@pycord-app

pycord-app Bot commented Jun 23, 2026

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3284/head:pr-3284
git checkout pr-3284

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3284/head

@NeloBlivion NeloBlivion modified the milestones: 2.9.0, 2.9.0rc1 Jun 23, 2026
@Soheab Soheab added the priority: low Low Priority label Jul 26, 2026
@Soheab Soheab added feature Implements a feature upcoming discord feature Involves a feature not yet fully released by Discord undocumented discord feature This isn't documented, might not receive support for it! labels Jul 26, 2026
Comment thread docs/api/enums.rst
Comment on lines +2711 to +2721
.. attribute:: image

Allow image files. This includes ``.png``, ``.gif``, ``.jpg``, ``.jpeg``, ``.jfif``, ``.webp``, and ``.avif``.

.. attribute:: video

Allow video files. This includes ``.mp4``, ``.mov``, ``.qt``, and ``.webm``.

.. attribute:: audio

Allow audio files. This includes ``.mp3``, ``.m4a``, ``.wav``, ``.ogg``, ``.opus``, and ``.flac``.

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.

Documented twice? Docstring in the class too. Not sure if that's even considered.

raise TypeError(
"items in file_types must be of type str or FileType"
)
if len(str(f)) > 16:

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 also checks the length of our enum values, which is a bit useless?

@Paillat-dev Paillat-dev added hold: testing This pull request requires further testing hold: changelog This pull request is missing a changelog entry labels Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Implements a feature hold: changelog This pull request is missing a changelog entry hold: testing This pull request requires further testing PA: All Contributors pending priority: low Low Priority undocumented discord feature This isn't documented, might not receive support for it! upcoming discord feature Involves a feature not yet fully released by Discord

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants