diff --git a/aiogram/types/chat_action.py b/aiogram/types/chat_action.py index 0fbd64da..f0b46614 100644 --- a/aiogram/types/chat_action.py +++ b/aiogram/types/chat_action.py @@ -20,16 +20,16 @@ class ChatAction(AutoName): Source: https://core.telegram.org/bots/api#sendchataction """ - TYPING: str = enum.auto() - UPLOAD_PHOTO: str = enum.auto() - RECORD_VIDEO: str = enum.auto() - UPLOAD_VIDEO: str = enum.auto() - RECORD_AUDIO: str = enum.auto() - UPLOAD_AUDIO: str = enum.auto() - RECORD_VOICE: str = enum.auto() - UPLOAD_VOICE: str = enum.auto() - UPLOAD_DOCUMENT: str = enum.auto() - FIND_LOCATION: str = enum.auto() - RECORD_VIDEO_NOTE: str = enum.auto() - UPLOAD_VIDEO_NOTE: str = enum.auto() - CHOOSE_STICKER: str = enum.auto() + TYPING = enum.auto() + UPLOAD_PHOTO = enum.auto() + RECORD_VIDEO = enum.auto() + UPLOAD_VIDEO = enum.auto() + UPLOAD_AUDIO = enum.auto() + RECORD_AUDIO = enum.auto() + RECORD_VOICE = enum.auto() + UPLOAD_VOICE = enum.auto() + UPLOAD_DOCUMENT = enum.auto() + FIND_LOCATION = enum.auto() + RECORD_VIDEO_NOTE = enum.auto() + UPLOAD_VIDEO_NOTE = enum.auto() + CHOOSE_STICKER = enum.auto() diff --git a/aiogram/utils/enum.py b/aiogram/utils/enum.py index 9e14795a..b239ebc0 100644 --- a/aiogram/utils/enum.py +++ b/aiogram/utils/enum.py @@ -1,7 +1,8 @@ import enum +from typing import Any, List class AutoName(str, enum.Enum): - - def _generate_next_value_(self, start, count, last_values) -> str: - return self.lower() + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> str: + return name.lower()