feat(components,commands): support restricting allowed file types in FileUpload modal components and slash command attachment options#1550
Conversation
FileUpload modal components and slash command attachment optionsFileUpload modal components and slash command attachment options
|
Could you clarify:
Are those pre-defined by discord, or are they library-supplied shorthands? I'm assuming the former, since the PR doesn't seem to include any lib-specific mechanisms |
Yup. The mappings are mentioned in the PR description (copied 1:1 from the announcement), I'm still kind of debating whether we should document them. |
Hmm, good point, I'll add those again to at least have them show up in the signature. |
848b634 to
535c0db
Compare
…types # Conflicts: # disnake/ext/commands/params.py


Summary
Note
This is in private testing at the moment, and will be made available to everyone within the next couple weeks.
This adds a
file_typesparameter/field tocomponents.FileUploadandui.FileUpload, as well asOptionandParam/ParamInfofor slash commands.Valid values are the predefined
image/video/audiogroups and arbitrary extensions such as.pdf, or any combination thereof (up to 10, where each one can be up to 16 chars).(and, once again, we're at a point where a
Sequence[str]that doesn't allowstrwould be great)Modal
FileUploadexampleChecklist
uv run nox -s lintuv run nox -s pyright