diff --git a/aiogram/types/chat_invite_link.py b/aiogram/types/chat_invite_link.py index 33593c2d..7476f9dc 100644 --- a/aiogram/types/chat_invite_link.py +++ b/aiogram/types/chat_invite_link.py @@ -1,7 +1,7 @@ from __future__ import annotations import datetime -from typing import TYPE_CHECKING, Optional, Union +from typing import TYPE_CHECKING, Optional from .base import TelegramObject @@ -28,7 +28,7 @@ class ChatInviteLink(TelegramObject): """:code:`True`, if the link is revoked""" name: Optional[str] = None """*Optional*. Invite link name""" - expire_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + expire_date: Optional[datetime.datetime] = None """*Optional*. Point in time (Unix timestamp) when the link will expire or has been expired""" member_limit: Optional[int] = None """*Optional*. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999""" diff --git a/aiogram/types/chat_member.py b/aiogram/types/chat_member.py index 5d306177..4e8c38e7 100644 --- a/aiogram/types/chat_member.py +++ b/aiogram/types/chat_member.py @@ -1,7 +1,7 @@ from __future__ import annotations import datetime -from typing import TYPE_CHECKING, Optional, Union +from typing import TYPE_CHECKING, Optional from .base import TelegramObject @@ -24,7 +24,7 @@ class ChatMember(TelegramObject): """ status: str - """...""" + """The member's status in the chat""" user: Optional[User] = None """*Optional*. Information about the user""" is_anonymous: Optional[bool] = None @@ -67,5 +67,5 @@ class ChatMember(TelegramObject): """*Optional*. :code:`True`, if the user is allowed to send animations, games, stickers and use inline bots""" can_add_web_page_previews: Optional[bool] = None """*Optional*. :code:`True`, if the user is allowed to add web page previews to their messages""" - until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + until_date: Optional[datetime.datetime] = None """*Optional*. Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever""" diff --git a/aiogram/types/chat_member_banned.py b/aiogram/types/chat_member_banned.py index 21b725e8..cbed5493 100644 --- a/aiogram/types/chat_member_banned.py +++ b/aiogram/types/chat_member_banned.py @@ -1,7 +1,7 @@ from __future__ import annotations import datetime -from typing import TYPE_CHECKING, Union +from typing import TYPE_CHECKING from pydantic import Field @@ -22,5 +22,5 @@ class ChatMemberBanned(ChatMember): """The member's status in the chat, always 'kicked'""" user: User """Information about the user""" - until_date: Union[datetime.datetime, datetime.timedelta, int] + until_date: datetime.datetime """Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever""" diff --git a/aiogram/types/chat_member_restricted.py b/aiogram/types/chat_member_restricted.py index 6cff8f53..cc6fe679 100644 --- a/aiogram/types/chat_member_restricted.py +++ b/aiogram/types/chat_member_restricted.py @@ -1,7 +1,7 @@ from __future__ import annotations import datetime -from typing import TYPE_CHECKING, Union +from typing import TYPE_CHECKING from pydantic import Field @@ -42,5 +42,5 @@ class ChatMemberRestricted(ChatMember): """:code:`True`, if the user is allowed to send animations, games, stickers and use inline bots""" can_add_web_page_previews: bool """:code:`True`, if the user is allowed to add web page previews to their messages""" - until_date: Union[datetime.datetime, datetime.timedelta, int] + until_date: datetime.datetime """Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever""" diff --git a/aiogram/types/input_message_content.py b/aiogram/types/input_message_content.py index 4d26d4f0..858524a5 100644 --- a/aiogram/types/input_message_content.py +++ b/aiogram/types/input_message_content.py @@ -1,9 +1,9 @@ from __future__ import annotations -from .base import TelegramObject +from .base import MutableTelegramObject -class InputMessageContent(TelegramObject): +class InputMessageContent(MutableTelegramObject): """ This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types: diff --git a/aiogram/types/menu_button.py b/aiogram/types/menu_button.py index 37707302..b37c2390 100644 --- a/aiogram/types/menu_button.py +++ b/aiogram/types/menu_button.py @@ -2,13 +2,13 @@ from __future__ import annotations from typing import TYPE_CHECKING, Optional -from .base import TelegramObject +from .base import MutableTelegramObject if TYPE_CHECKING: from .web_app_info import WebAppInfo -class MenuButton(TelegramObject): +class MenuButton(MutableTelegramObject): """ This object describes the bot's menu button in a private chat. It should be one of @@ -22,7 +22,7 @@ class MenuButton(TelegramObject): """ type: str - """...""" + """Type of the button""" text: Optional[str] = None """*Optional*. Text on the button""" web_app: Optional[WebAppInfo] = None diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index 6a7fb538..39773a66 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -19,9 +19,9 @@ class MessageEntity(MutableTelegramObject): type: str """Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)""" offset: int - """Offset in UTF-16 code units to the start of the entity""" + """Offset in `UTF-16 code units `_ to the start of the entity""" length: int - """Length of the entity in UTF-16 code units""" + """Length of the entity in `UTF-16 code units `_""" url: Optional[str] = None """*Optional*. For 'text_link' only, URL that will be opened after user taps on the text""" user: Optional[User] = None diff --git a/aiogram/types/poll.py b/aiogram/types/poll.py index 2301235d..fb979a58 100644 --- a/aiogram/types/poll.py +++ b/aiogram/types/poll.py @@ -1,7 +1,7 @@ from __future__ import annotations import datetime -from typing import TYPE_CHECKING, List, Optional, Union +from typing import TYPE_CHECKING, List, Optional from .base import TelegramObject @@ -41,5 +41,5 @@ class Poll(TelegramObject): """*Optional*. Special entities like usernames, URLs, bot commands, etc. that appear in the *explanation*""" open_period: Optional[int] = None """*Optional*. Amount of time in seconds the poll will be active after creation""" - close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + close_date: Optional[datetime.datetime] = None """*Optional*. Point in time (Unix timestamp) when the poll will be automatically closed""" diff --git a/aiogram/types/reply_keyboard_markup.py b/aiogram/types/reply_keyboard_markup.py index 334168bd..ed64e660 100644 --- a/aiogram/types/reply_keyboard_markup.py +++ b/aiogram/types/reply_keyboard_markup.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: class ReplyKeyboardMarkup(MutableTelegramObject): """ - This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). + This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). Source: https://core.telegram.org/bots/api#replykeyboardmarkup """