diff --git a/.butcher/enums/StickerType.yml b/.butcher/enums/StickerType.yml new file mode 100644 index 00000000..5fd3542e --- /dev/null +++ b/.butcher/enums/StickerType.yml @@ -0,0 +1,9 @@ +name: StickerType +description: | + The part of the face relative to which the mask should be placed. + + Source: https://core.telegram.org/bots/api#maskposition +parse: + entity: Sticker + attribute: type + regexp: "'([a-z_]+)'" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ffe7b117..870c3366 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,17 +33,17 @@ repos: args: [ '--config=.flake8' ] files: *files - - repo: https://github.com/floatingpurr/sync_with_poetry - rev: 0.2.0 - hooks: - - id: sync_with_poetry +# - repo: https://github.com/floatingpurr/sync_with_poetry +# rev: 0.2.0 +# hooks: +# - id: sync_with_poetry - repo: https://github.com/python-poetry/poetry rev: '1.2.1' hooks: - id: poetry-check - - id: poetry-lock - args: [ "--no-update" ] +# - id: poetry-lock +# args: [ "--no-update" ] - id: poetry-export args: [ "-f", "requirements.txt", "--without-hashes", "-o", "requirements/base.txt" ] - id: poetry-export diff --git a/aiogram/enums/sticker_type.py b/aiogram/enums/sticker_type.py new file mode 100644 index 00000000..748f85e6 --- /dev/null +++ b/aiogram/enums/sticker_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class StickerType(str, Enum): + """ + The part of the face relative to which the mask should be placed. + + Source: https://core.telegram.org/bots/api#maskposition + """ + + REGULAR = "regular" + MASK = "mask" + CUSTOM_EMOJI = "custom_emoji" diff --git a/aiogram/utils/enum.py b/aiogram/utils/enum.py deleted file mode 100644 index b239ebc0..00000000 --- a/aiogram/utils/enum.py +++ /dev/null @@ -1,8 +0,0 @@ -import enum -from typing import Any, List - - -class AutoName(str, enum.Enum): - @staticmethod - def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> str: - return name.lower() diff --git a/docs/api/enums/index.rst b/docs/api/enums/index.rst index e0eff3cf..a95836a0 100644 --- a/docs/api/enums/index.rst +++ b/docs/api/enums/index.rst @@ -21,5 +21,6 @@ Here is list of all available enums: message_entity_type parse_mode poll_type + sticker_type topic_icon_color update_type diff --git a/docs/api/enums/sticker_type.rst b/docs/api/enums/sticker_type.rst new file mode 100644 index 00000000..549c1d27 --- /dev/null +++ b/docs/api/enums/sticker_type.rst @@ -0,0 +1,9 @@ +########### +StickerType +########### + + +.. automodule:: aiogram.enums.sticker_type + :members: + :member-order: bysource + :undoc-members: True