mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Refactor profile photo types to use InputProfilePhotoType enums instead of hardcoded literals
This commit is contained in:
parent
a75a5a5fdc
commit
5066e5e82f
3 changed files with 5 additions and 5 deletions
|
|
@ -5,7 +5,7 @@ description: |
|
|||
Source: https://core.telegram.org/bots/api#inputprofilephoto
|
||||
multi_parse:
|
||||
attribute: type
|
||||
regexp: "must be '([a-z_]+)'"
|
||||
regexp: "must be *([a-z_]+)*"
|
||||
entities:
|
||||
- InputProfilePhotoStatic
|
||||
- InputProfilePhotoAnimated
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class InputProfilePhotoAnimated(InputProfilePhoto):
|
|||
Source: https://core.telegram.org/bots/api#inputprofilephotoanimated
|
||||
"""
|
||||
|
||||
type: Literal["animated"] = "animated"
|
||||
type: Literal[InputProfilePhotoType.ANIMATED] = InputProfilePhotoType.ANIMATED
|
||||
"""Type of the profile photo, must be *animated*"""
|
||||
animation: InputFileUnion
|
||||
"""The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
|
|
@ -29,7 +29,7 @@ class InputProfilePhotoAnimated(InputProfilePhoto):
|
|||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal["animated"] = "animated",
|
||||
type: Literal[InputProfilePhotoType.ANIMATED] = InputProfilePhotoType.ANIMATED,
|
||||
animation: InputFileUnion,
|
||||
main_frame_timestamp: Optional[float] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class InputProfilePhotoStatic(InputProfilePhoto):
|
|||
Source: https://core.telegram.org/bots/api#inputprofilephotostatic
|
||||
"""
|
||||
|
||||
type: Literal["static"] = "static"
|
||||
type: Literal[InputProfilePhotoType.STATIC] = InputProfilePhotoType.STATIC
|
||||
"""Type of the profile photo, must be *static*"""
|
||||
photo: InputFileUnion
|
||||
"""The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the photo was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
|
|
@ -27,7 +27,7 @@ class InputProfilePhotoStatic(InputProfilePhoto):
|
|||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal["static"] = "static",
|
||||
type: Literal[InputProfilePhotoType.STATIC] = InputProfilePhotoType.STATIC,
|
||||
photo: InputFileUnion,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue