Added MaskPositionPoint, InlineQueryResultType enums

This commit is contained in:
Alex Root Junior 2022-11-22 23:50:16 +02:00
parent c60ee8e40e
commit 5851afca98
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
32 changed files with 147 additions and 25 deletions

View file

@ -7,3 +7,5 @@ parse:
entity: Chat
attribute: type
regexp: "'([a-z]+)'"
static:
SENDER: sender

View file

@ -0,0 +1,29 @@
name: InlineQueryResultType
description: |
The part of the face relative to which the mask should be placed.
Source: https://core.telegram.org/bots/api#maskposition
multi_parse:
attribute: type
regexp: "must be ([a-z_]+)"
entities:
- InlineQueryResultCachedAudio
- InlineQueryResultCachedDocument
- InlineQueryResultCachedGif
- InlineQueryResultCachedMpeg4Gif
- InlineQueryResultCachedPhoto
- InlineQueryResultCachedSticker
- InlineQueryResultCachedVideo
- InlineQueryResultCachedVoice
- InlineQueryResultArticle
- InlineQueryResultAudio
- InlineQueryResultContact
- InlineQueryResultGame
- InlineQueryResultDocument
- InlineQueryResultGif
- InlineQueryResultLocation
- InlineQueryResultMpeg4Gif
- InlineQueryResultPhoto
- InlineQueryResultVenue
- InlineQueryResultVideo
- InlineQueryResultVoice

View file

@ -0,0 +1,9 @@
name: MaskPositionPoint
description: |
The part of the face relative to which the mask should be placed.
Source: https://core.telegram.org/bots/api#maskposition
parse:
entity: MaskPosition
attribute: point
regexp: "'([a-z_]+)'"

View file

@ -4,7 +4,9 @@ from .chat_member_status import ChatMemberStatus
from .chat_type import ChatType
from .content_type import ContentType
from .dice_emoji import DiceEmoji
from .inline_query_result_type import InlineQueryResultType
from .input_media_type import InputMediaType
from .mask_position_point import MaskPositionPoint
from .menu_button_type import MenuButtonType
from .message_entity_type import MessageEntityType
from .parse_mode import ParseMode
@ -19,7 +21,9 @@ __all__ = (
"ChatType",
"ContentType",
"DiceEmoji",
"InlineQueryResultType",
"InputMediaType",
"MaskPositionPoint",
"MenuButtonType",
"MessageEntityType",
"ParseMode",

View file

@ -8,6 +8,7 @@ class ChatType(str, Enum):
Source: https://core.telegram.org/bots/api#chat
"""
SENDER = "sender"
PRIVATE = "private"
GROUP = "group"
SUPERGROUP = "supergroup"

View file

@ -0,0 +1,23 @@
from enum import Enum
class InlineQueryResultType(str, Enum):
"""
The part of the face relative to which the mask should be placed.
Source: https://core.telegram.org/bots/api#maskposition
"""
AUDIO = "audio"
DOCUMENT = "document"
GIF = "gif"
MPEG = "mpeg"
PHOTO = "photo"
STICKER = "sticker"
VIDEO = "video"
VOICE = "voice"
ARTICLE = "article"
CONTACT = "contact"
GAME = "game"
LOCATION = "location"
VENUE = "venue"

View file

@ -0,0 +1,14 @@
from enum import Enum
class MaskPositionPoint(str, Enum):
"""
The part of the face relative to which the mask should be placed.
Source: https://core.telegram.org/bots/api#maskposition
"""
FOREHEAD = "forehead"
EYES = "eyes"
MOUTH = "mouth"
CHIN = "chin"

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -18,7 +19,7 @@ class InlineQueryResultArticle(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultarticle
"""
type: str = Field("article", const=True)
type: str = Field(InlineQueryResultType.ARTICLE, const=True)
"""Type of the result, must be *article*"""
id: str
"""Unique identifier for this result, 1-64 Bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultAudio(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultaudio
"""
type: str = Field("audio", const=True)
type: str = Field(InlineQueryResultType.AUDIO, const=True)
"""Type of the result, must be *audio*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedaudio
"""
type: str = Field("audio", const=True)
type: str = Field(InlineQueryResultType.AUDIO, const=True)
"""Type of the result, must be *audio*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcacheddocument
"""
type: str = Field("document", const=True)
type: str = Field(InlineQueryResultType.DOCUMENT, const=True)
"""Type of the result, must be *document*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultCachedGif(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedgif
"""
type: str = Field("gif", const=True)
type: str = Field(InlineQueryResultType.GIF, const=True)
"""Type of the result, must be *gif*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif
"""
type: str = Field("mpeg4_gif", const=True)
type: str = Field(InlineQueryResultType.MPEG, const=True)
"""Type of the result, must be *mpeg4_gif*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedphoto
"""
type: str = Field("photo", const=True)
type: str = Field(InlineQueryResultType.PHOTO, const=True)
"""Type of the result, must be *photo*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -19,7 +20,7 @@ class InlineQueryResultCachedSticker(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedsticker
"""
type: str = Field("sticker", const=True)
type: str = Field(InlineQueryResultType.STICKER, const=True)
"""Type of the result, must be *sticker*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedvideo
"""
type: str = Field("video", const=True)
type: str = Field(InlineQueryResultType.VIDEO, const=True)
"""Type of the result, must be *video*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcachedvoice
"""
type: str = Field("voice", const=True)
type: str = Field(InlineQueryResultType.VOICE, const=True)
"""Type of the result, must be *voice*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -19,7 +20,7 @@ class InlineQueryResultContact(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultcontact
"""
type: str = Field("contact", const=True)
type: str = Field(InlineQueryResultType.CONTACT, const=True)
"""Type of the result, must be *contact*"""
id: str
"""Unique identifier for this result, 1-64 Bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultDocument(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultdocument
"""
type: str = Field("document", const=True)
type: str = Field(InlineQueryResultType.DOCUMENT, const=True)
"""Type of the result, must be *document*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -18,7 +19,7 @@ class InlineQueryResultGame(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultgame
"""
type: str = Field("game", const=True)
type: str = Field(InlineQueryResultType.GAME, const=True)
"""Type of the result, must be *game*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultGif(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultgif
"""
type: str = Field("gif", const=True)
type: str = Field(InlineQueryResultType.GIF, const=True)
"""Type of the result, must be *gif*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -19,7 +20,7 @@ class InlineQueryResultLocation(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultlocation
"""
type: str = Field("location", const=True)
type: str = Field(InlineQueryResultType.LOCATION, const=True)
"""Type of the result, must be *location*"""
id: str
"""Unique identifier for this result, 1-64 Bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif
"""
type: str = Field("mpeg4_gif", const=True)
type: str = Field(InlineQueryResultType.MPEG, const=True)
"""Type of the result, must be *mpeg4_gif*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -20,7 +21,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultphoto
"""
type: str = Field("photo", const=True)
type: str = Field(InlineQueryResultType.PHOTO, const=True)
"""Type of the result, must be *photo*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .inline_query_result import InlineQueryResult
if TYPE_CHECKING:
@ -19,7 +20,7 @@ class InlineQueryResultVenue(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultvenue
"""
type: str = Field("venue", const=True)
type: str = Field(InlineQueryResultType.VENUE, const=True)
"""Type of the result, must be *venue*"""
id: str
"""Unique identifier for this result, 1-64 Bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -22,7 +23,7 @@ class InlineQueryResultVideo(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultvideo
"""
type: str = Field("video", const=True)
type: str = Field(InlineQueryResultType.VIDEO, const=True)
"""Type of the result, must be *video*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, List, Optional
from pydantic import Field
from ..enums import InlineQueryResultType
from .base import UNSET
from .inline_query_result import InlineQueryResult
@ -21,7 +22,7 @@ class InlineQueryResultVoice(InlineQueryResult):
Source: https://core.telegram.org/bots/api#inlinequeryresultvoice
"""
type: str = Field("voice", const=True)
type: str = Field(InlineQueryResultType.VOICE, const=True)
"""Type of the result, must be *voice*"""
id: str
"""Unique identifier for this result, 1-64 bytes"""

View file

@ -14,7 +14,9 @@ Here is list of all available enums:
chat_type
content_type
dice_emoji
inline_query_result_type
input_media_type
mask_position_point
menu_button_type
message_entity_type
parse_mode

View file

@ -0,0 +1,9 @@
#####################
InlineQueryResultType
#####################
.. automodule:: aiogram.enums.inline_query_result_type
:members:
:member-order: bysource
:undoc-members: True

View file

@ -0,0 +1,9 @@
#################
MaskPositionPoint
#################
.. automodule:: aiogram.enums.mask_position_point
:members:
:member-order: bysource
:undoc-members: True

8
poetry.lock generated
View file

@ -176,7 +176,7 @@ uvloop = ["uvloop (>=0.15.2)"]
[[package]]
name = "butcher"
version = "0.1.7"
version = "0.1.8"
description = "Code-generation utility for aiogram v3 core developers"
category = "dev"
optional = false
@ -199,8 +199,8 @@ requests = "^2.28.1"
[package.source]
type = "git"
url = "https://github.com/aiogram/butcher.git"
reference = "v0.1.7"
resolved_reference = "a0a428c5bd37a212ee168feddfc38d6934b08e18"
reference = "v0.1.8"
resolved_reference = "88a9e90742190e962877d475cbfeb1d66be699b7"
[[package]]
name = "certifi"
@ -1353,7 +1353,7 @@ redis = ["redis"]
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "e0f20dd2f11859f031e6d77751dc8b757519fb24e67b0eb03490c20695bd9705"
content-hash = "475ca0c579e3997fe16a79826e94f7a4f7bc99a98edbd33fc6579580af0582d0"
[metadata.files]
about-time = [

View file

@ -97,7 +97,7 @@ toml = "^0.10.2"
pre-commit = "^2.20.0"
packaging = "^21.3"
typing-extensions = "^4.3.0"
butcher = { git = "https://github.com/aiogram/butcher.git", rev = "v0.1.7", python = "3.10" }
butcher = { git = "https://github.com/aiogram/butcher.git", rev = "v0.1.8", python = "3.10" }
[tool.poetry.extras]