-
Notifications
You must be signed in to change notification settings - Fork 141
feat(flags): add new flags to Embed and update Attachment flags #1283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
return 1 << 3 | ||
|
||
@flag_value | ||
def contains_explicit_media(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on calling this something different? Like is_nsfw
or is_explicit
""" | ||
|
||
@flag_value | ||
def contains_explicit_media(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on calling this something different? Like is_nsfw
or is_explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think following the API naming is okay
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 | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Eneg <[email protected]> Signed-off-by: arielle <[email protected]>
Summary
Checklist
pdm lint
pdm pyright