-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat(flags): add new flags to Embed and update Attachment flags #1283
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
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
@@ -220,6 +223,7 @@ def __init__( | |||
self._image: Optional[EmbedImagePayload] = None | |||
self._footer: Optional[EmbedFooterPayload] = None | |||
self._fields: Optional[List[EmbedFieldPayload]] = None | |||
self._flags: Optional[int] = None |
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.
Why not default to 0?
@@ -455,6 +477,11 @@ def image(self) -> _EmbedMediaProxy: | |||
- ``proxy_url`` | |||
- ``width`` | |||
- ``height`` | |||
- ``flags`` | |||
|
|||
.. versionchanged:: 2.11 |
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.
Shouldn't it be versionadded
?
Summary
Checklist
pdm lint
pdm pyright