Skip to content
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d8e1eef
fix(state): ensure _messages is not None before updating message list
plun1331 Sep 12, 2025
9d3b32b
chore: update changelog
plun1331 Sep 12, 2025
f32b688
feat: FileUpload in Modals
plun1331 Sep 18, 2025
9af88cf
Merge remote-tracking branch 'origin/master' into feat/model3
plun1331 Sep 18, 2025
b025df5
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2025
590a7a2
changelog & docs
plun1331 Sep 18, 2025
9c42603
ahh! nobody look! my shitty debug code!
plun1331 Sep 18, 2025
498c28b
add fileupload to __all__
plun1331 Sep 18, 2025
033f684
more changelog!!
plun1331 Sep 18, 2025
14665b6
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2025
7ba0276
docs n enums n stuff
plun1331 Sep 18, 2025
a00d79e
Merge remote-tracking branch 'origin/feat/model3' into feat/model3
plun1331 Sep 18, 2025
a903005
oh god more debug code
plun1331 Sep 18, 2025
6e36204
that aint right
plun1331 Sep 18, 2025
7a66cb7
that *still* aint right
plun1331 Sep 18, 2025
7bff68a
Apply suggestion from @Soheab
plun1331 Sep 18, 2025
b356c75
suggested review changes
plun1331 Sep 18, 2025
4478fcb
Merge remote-tracking branch 'origin/feat/model3' into feat/model3
plun1331 Sep 18, 2025
9a08c32
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2025
a7fa66a
suggested review changes
plun1331 Sep 18, 2025
b9283b6
Merge remote-tracking branch 'origin/feat/model3' into feat/model3
plun1331 Sep 18, 2025
cfc2e5e
they can go in more than messages
plun1331 Sep 18, 2025
0b55aba
this is becoming a very large example
plun1331 Sep 18, 2025
99417f9
Update examples/modal_dialogs.py
plun1331 Sep 18, 2025
c0af721
Update discord/types/components.py (thanks copilot)
plun1331 Sep 26, 2025
46030b3
Apply suggestions from code review
plun1331 Oct 2, 2025
f3df97f
style(pre-commit): auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion examples/modal_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ def __init__(self, *args, **kwargs) -> None:
description="If it is not listed, skip this question.",
required=False,
),
discord.ui.FileUpload(
label="What's your favorite picture?",
max_values=1,
description="You may only pick one! Chose wisely!",
required=False,
),
*args,
**kwargs,
)

async def callback(self, interaction: discord.Interaction):
await interaction.response.defer()
embed = discord.Embed(
title="Your Modal Results",
fields=[
Expand All @@ -50,10 +57,19 @@ async def callback(self, interaction: discord.Interaction):
discord.EmbedField(
name="Second Input", value=self.children[1].value, inline=False
),
discord.EmbedField(
name="Favorite Color", value=self.children[2].value, inline=False
),
],
color=discord.Color.random(),
)
await interaction.response.send_message(embeds=[embed])
attachment = self.children[3].values[0] if self.children[3].values else None
if attachment:
embed.set_image(url=f"attachments://{attachment.filename}")
await interaction.response.send_message(
embeds=[embed],
files=[await attachment.to_file()] if attachment else [],
)


@bot.slash_command(name="modaltest")
Expand Down
Loading