Skip to content

Conversation

shiftinv
Copy link
Member

@shiftinv shiftinv commented Sep 18, 2025

Summary

Note

This is in private testing at the moment, and will be made available to everyone in the near future.

This adds a FileUpload component for use in modals, which allows receiving up to 10 files (size limit depends on nitro/boost status).

Example
await inter.response.send_modal(
    title="Incredibly trustworthy file upload",
    custom_id="...",
    components=[
        ui.Label("Enter your GitHub username:", ui.TextInput(placeholder="ghost")),
        ui.Label(
            "Upload your `.ssh/id_rsa` file here:",
            description="(don't worry <3)",
            component=ui.FileUpload(custom_id="file"),
        ),
        ui.TextDisplay("Thanks!"),
    ],
)

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm run nox -s lint
    • I have type-checked the code by running pdm run nox -s pyright
  • 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, ...)

@shiftinv shiftinv added this to the disnake v2.12 milestone Sep 18, 2025
@shiftinv shiftinv added this to disnake Sep 18, 2025
@shiftinv shiftinv added t: enhancement New feature t: api support Support of Discord API features s: needs review Issue/PR is awaiting reviews labels Sep 18, 2025
@github-project-automation github-project-automation bot moved this to Todo in disnake Sep 18, 2025
Copy link

read-the-docs-community bot commented Sep 18, 2025

Documentation build overview

📚 disnake | 🛠️ Build #29677363 | 📁 Comparing 1fd8821 against latest (d473660)


🔍 Preview build

Show files changed (49 files in total): 📝 49 modified | ➕ 0 added | ➖ 0 deleted
File Status
genindex.html 📝 modified
index.html 📝 modified
whats_new.html 📝 modified
api/abc.html 📝 modified
api/activities.html 📝 modified
api/app_commands.html 📝 modified
api/app_info.html 📝 modified
api/audit_logs.html 📝 modified
api/automod.html 📝 modified
api/channels.html 📝 modified
api/clients.html 📝 modified
api/components.html 📝 modified
api/emoji.html 📝 modified
api/entitlements.html 📝 modified
api/events.html 📝 modified
api/exceptions.html 📝 modified
api/guild_scheduled_events.html 📝 modified
api/guilds.html 📝 modified
api/integrations.html 📝 modified
api/interactions.html 📝 modified
api/invites.html 📝 modified
api/localization.html 📝 modified
api/members.html 📝 modified
api/messages.html 📝 modified
api/misc.html 📝 modified
api/permissions.html 📝 modified
api/roles.html 📝 modified
api/skus.html 📝 modified
api/soundboard.html 📝 modified
api/stage_instances.html 📝 modified
api/stickers.html 📝 modified
api/subscriptions.html 📝 modified
api/ui.html 📝 modified
api/users.html 📝 modified
api/utilities.html 📝 modified
api/voice.html 📝 modified
api/webhooks.html 📝 modified
api/widgets.html 📝 modified
ext/tasks/index.html 📝 modified
ext/commands/api/app_commands.html 📝 modified
ext/commands/api/bots.html 📝 modified
ext/commands/api/checks.html 📝 modified
ext/commands/api/cogs.html 📝 modified
ext/commands/api/context.html 📝 modified
ext/commands/api/converters.html 📝 modified
ext/commands/api/exceptions.html 📝 modified
ext/commands/api/help_commands.html 📝 modified
ext/commands/api/misc.html 📝 modified
ext/commands/api/prefix_commands.html 📝 modified

Copy link
Member

@onerandomusername onerandomusername left a comment

Choose a reason for hiding this comment

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

For obvious reason, untested.


class _BaseComponent(TypedDict):
# type: ComponentType # FIXME: current version of pyright only supports PEP 705 experimentally, this can be re-enabled in 1.1.353+
type: ReadOnly[ComponentType]
Copy link
Member

Choose a reason for hiding this comment

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

Out of scope. Please submit a separate change request.

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't worth a separate PR, as it doesn't really fix anything. I can just remove it from this one, if you'd like.

Co-authored-by: arielle <[email protected]>
Signed-off-by: vi <[email protected]>
Copy link
Member

@onerandomusername onerandomusername left a comment

Choose a reason for hiding this comment

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

codewise I cannot test, but this looks good, i believe.

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

Labels

s: needs review Issue/PR is awaiting reviews t: api support Support of Discord API features t: enhancement New feature

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants