mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Added missing FORUM_TOPIC_EDITED value to content_type property (#1160)
* Added missing FORUM_TOPIC_EDITED value to content_type property * Added changelog to CHANGES * Fixed aiogram/filters/magic_data.py:21:41: C416 Unnecessary `dict` comprehension (rewrite using `dict()`) * Resolve #1155: Different signature of startup/shutdown events on polling and webhooks (#1156) * Code refactor - Use 'or' istead of 'A if A else B' - Raise new error from catched error: raise Error from e * Fixed signature of startup/shutdown events - Include the **dispatcher.workflow_data as the handler arguments * Update deep_linking basic examples (#1151) * skip if current router does not have observer for custom event (#1147) * skip if current router does not have observer for custom event * Test custom event in router * Feature changelog file * fix style * Change `InlineQueryResultType.MPEG` to more correct (#1146) * Change `InlineQueryResultType.MPEG` to `InlineQueryResultType.MPEG4GIF` * Change regexp for parse entities * Use code generator to fix types * Add changelog * fix(docs): fix wrong page link in docs (#1154) * storage cleanup (#1144) * storage cleanup * storage cleanup * Update API docs * Added tests * Fix tests --------- Co-authored-by: Alex Root Junior <jroot.junior@gmail.com> Co-authored-by: Łukasz Tshipenchko <dev@zxc.sx> Co-authored-by: Max Kotsiuruba <81016938+A5KET@users.noreply.github.com> Co-authored-by: Andrey Tikhonov <andrey.tikhonov@quantori.com> Co-authored-by: Desiders <47452083+Desiders@users.noreply.github.com> Co-authored-by: Daniil <hum4noid@yandex.ru> Co-authored-by: RootShinobi <111008396+RootShinobi@users.noreply.github.com>
This commit is contained in:
parent
d15502c2af
commit
8d2bf20fb8
3 changed files with 15 additions and 0 deletions
1
CHANGES/1160.bugfix
Normal file
1
CHANGES/1160.bugfix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Added missing FORUM_TOPIC_EDITED value to content_type property
|
||||
|
|
@ -317,6 +317,8 @@ class Message(TelegramObject):
|
|||
return ContentType.MESSAGE_AUTO_DELETE_TIMER_CHANGED
|
||||
if self.forum_topic_created:
|
||||
return ContentType.FORUM_TOPIC_CREATED
|
||||
if self.forum_topic_edited:
|
||||
return ContentType.FORUM_TOPIC_EDITED
|
||||
if self.forum_topic_closed:
|
||||
return ContentType.FORUM_TOPIC_CLOSED
|
||||
if self.forum_topic_reopened:
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ from aiogram.types import (
|
|||
Document,
|
||||
EncryptedCredentials,
|
||||
ForumTopicClosed,
|
||||
ForumTopicEdited,
|
||||
ForumTopicCreated,
|
||||
ForumTopicReopened,
|
||||
Game,
|
||||
|
|
@ -414,6 +415,16 @@ TEST_FORUM_TOPIC_CREATED = Message(
|
|||
icon_color=0xFFD67E,
|
||||
),
|
||||
)
|
||||
TEST_FORUM_TOPIC_EDITED = Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
chat=Chat(id=42, type="private"),
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
forum_topic_edited=ForumTopicEdited(
|
||||
name="test_edited",
|
||||
icon_color=0xFFD67E,
|
||||
),
|
||||
)
|
||||
TEST_FORUM_TOPIC_CLOSED = Message(
|
||||
message_id=42,
|
||||
date=datetime.datetime.now(),
|
||||
|
|
@ -484,6 +495,7 @@ class TestMessage:
|
|||
[TEST_MESSAGE_DICE, ContentType.DICE],
|
||||
[TEST_MESSAGE_WEB_APP_DATA, ContentType.WEB_APP_DATA],
|
||||
[TEST_FORUM_TOPIC_CREATED, ContentType.FORUM_TOPIC_CREATED],
|
||||
[TEST_FORUM_TOPIC_EDITED, ContentType.FORUM_TOPIC_EDITED],
|
||||
[TEST_FORUM_TOPIC_CLOSED, ContentType.FORUM_TOPIC_CLOSED],
|
||||
[TEST_FORUM_TOPIC_REOPENED, ContentType.FORUM_TOPIC_REOPENED],
|
||||
[TEST_MESSAGE_UNKNOWN, ContentType.UNKNOWN],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue