Skip to content

feat(flags): add new flags to Embed and update Attachment flags - #1283

Open
Snipy7374 wants to merge 19 commits into
DisnakeDev:masterfrom
Snipy7374:feat/flags
Open

feat(flags): add new flags to Embed and update Attachment flags#1283
Snipy7374 wants to merge 19 commits into
DisnakeDev:masterfrom
Snipy7374:feat/flags

Conversation

@Snipy7374

Copy link
Copy Markdown
Collaborator

Summary

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 lint
    • I have type-checked the code by running pdm 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, ...)

Snipy7374

This comment was marked as off-topic.

Comment thread disnake/flags.py
Comment thread disnake/flags.py Outdated
Comment thread disnake/embeds.py Outdated
Comment on lines +274 to +284
if self._thumbnail and (thumbnail_flags := self._thumbnail.get("flags")):
self._thumbnail["flags"] = EmbedMediaFlags._from_value(thumbnail_flags) # type: ignore

self._video = data.get("video")
self._provider = data.get("provider")
self._author = data.get("author")

self._image = data.get("image")
if self._image and (image_flags := self._image.get("flags")):
self._image["flags"] = EmbedMediaFlags._from_value(image_flags) # type: ignore

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't like how this is done but I don't see much alternatives

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rather than save it here, we could make the flags when we access the image or thumbnail, no?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This also no longer seems to be respected in serialisation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This also no longer seems to be respected in serialisation.

What do you mean? It's not consistent with the lib?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rather than save it here, we could make the flags when we access the image or thumbnail, no?

that was my idea as well. It's still a bit awkward, but a separate EmbedProxy subclass that special-cases flags should do, and doesn't result in weird consistency issues with from_dict and to_dict.

@Snipy7374 Snipy7374 added t: enhancement New feature t: api support Support of Discord API features s: waiting for api/docs Issue/PR is waiting for API support/documentation labels Jan 31, 2025
Comment thread disnake/embeds.py Outdated
Comment thread disnake/embeds.py Outdated
@Snipy7374
Snipy7374 requested review from Enegg and shiftinv and removed request for Enegg August 22, 2025 09:25
Comment thread disnake/embeds.py
@onerandomusername onerandomusername added this to the disnake v2.11 milestone Sep 7, 2025
Co-authored-by: Eneg <42005170+Enegg@users.noreply.github.com>
Signed-off-by: arielle <me@arielle.codes>
@onerandomusername onerandomusername removed the s: waiting for api/docs Issue/PR is waiting for API support/documentation label Sep 9, 2025
@shiftinv shiftinv removed this from the disnake v2.11 milestone Sep 10, 2025
@read-the-docs-community

read-the-docs-community Bot commented Sep 29, 2025

Copy link
Copy Markdown

Documentation build overview

📚 disnake | 🛠️ Build #34447815 | 📁 Comparing 0ba596f against latest (57e1005)

  🔍 Preview build  

53 files changed · ± 53 modified

± Modified

@onerandomusername

Copy link
Copy Markdown
Member

@Snipy7374 would you please resolve conflicts and rebase?

Comment thread changelog/1282.feature.rst Outdated
Comment thread disnake/types/embed.py Outdated
Comment thread disnake/embeds.py Outdated
Comment thread disnake/embeds.py Outdated
Comment thread disnake/flags.py Outdated
Comment thread disnake/flags.py
Comment thread disnake/flags.py Outdated
Comment thread disnake/flags.py Outdated
Comment thread disnake/message.py Outdated
Comment thread disnake/message.py
@shiftinv

shiftinv commented Sep 7, 2026

Copy link
Copy Markdown
Member

@Snipy7374 any update on this? Would be great to have these flags available, especially for implementing attachment editing later on.

@Snipy7374

Copy link
Copy Markdown
Collaborator Author

@Snipy7374 any update on this? Would be great to have these flags available, especially for implementing attachment editing later on.

Yes sir 🫡 , will try to complete my open PRs this week

Snipy7374 and others added 8 commits September 8, 2026 10:15
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Co-authored-by: vi <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: Snipy7374 <100313469+Snipy7374@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t: api support Support of Discord API features t: enhancement New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Embed and new Attachment flags

4 participants