diff --git a/.butcher/enums/InlineQueryResultType.yml b/.butcher/enums/InlineQueryResultType.yml index 74428a3c..2d823438 100644 --- a/.butcher/enums/InlineQueryResultType.yml +++ b/.butcher/enums/InlineQueryResultType.yml @@ -5,7 +5,7 @@ description: | Source: https://core.telegram.org/bots/api#inlinequeryresult multi_parse: attribute: type - regexp: "must be ([a-z_]+)" + regexp: "must be ([a-z_0-9]+)" entities: - InlineQueryResultCachedAudio - InlineQueryResultCachedDocument diff --git a/CHANGES/1146.bugfix.rst b/CHANGES/1146.bugfix.rst new file mode 100644 index 00000000..fbe88e4c --- /dev/null +++ b/CHANGES/1146.bugfix.rst @@ -0,0 +1,4 @@ +Change type of result in InlineQueryResult enum for `InlineQueryResultCachedMpeg4Gif` +and `InlineQueryResultMpeg4Gif` to more correct according to documentation. + +Change regexp for entities parsing to more correct (`InlineQueryResultType.yml`). diff --git a/aiogram/enums/inline_query_result_type.py b/aiogram/enums/inline_query_result_type.py index 771dc498..ae20045a 100644 --- a/aiogram/enums/inline_query_result_type.py +++ b/aiogram/enums/inline_query_result_type.py @@ -11,7 +11,7 @@ class InlineQueryResultType(str, Enum): AUDIO = "audio" DOCUMENT = "document" GIF = "gif" - MPEG = "mpeg" + MPEG4_GIF = "mpeg4_gif" PHOTO = "photo" STICKER = "sticker" VIDEO = "video" diff --git a/aiogram/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py index ab7a2a9b..539de025 100644 --- a/aiogram/types/inline_query_result_cached_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_cached_mpeg4_gif.py @@ -21,7 +21,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): Source: https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif """ - type: str = Field(InlineQueryResultType.MPEG, const=True) + type: str = Field(InlineQueryResultType.MPEG4_GIF, const=True) """Type of the result, must be *mpeg4_gif*""" id: str """Unique identifier for this result, 1-64 bytes""" diff --git a/aiogram/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py index 44a61fee..06c73620 100644 --- a/aiogram/types/inline_query_result_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_mpeg4_gif.py @@ -21,7 +21,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): Source: https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif """ - type: str = Field(InlineQueryResultType.MPEG, const=True) + type: str = Field(InlineQueryResultType.MPEG4_GIF, const=True) """Type of the result, must be *mpeg4_gif*""" id: str """Unique identifier for this result, 1-64 bytes"""