From b0b7040206a05e4cbb7af7021a3a0fecd99d5a44 Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 25 Jul 2025 00:54:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B0=D1=82=D1=82=D1=80=D0=B8=D0=B1=D1=83=D1=82=20is?= =?UTF-8?q?=5Fchannel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maxapi/types/updates/bot_added.py | 8 +++++--- maxapi/types/updates/bot_removed.py | 8 +++++--- maxapi/types/updates/user_added.py | 8 +++++--- maxapi/types/updates/user_removed.py | 6 ++++-- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/maxapi/types/updates/bot_added.py b/maxapi/types/updates/bot_added.py index ad79f2f..f1ec645 100644 --- a/maxapi/types/updates/bot_added.py +++ b/maxapi/types/updates/bot_added.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Optional from .update import Update @@ -14,12 +14,14 @@ class BotAdded(Update): Обновление, сигнализирующее о добавлении бота в чат. Attributes: - chat_id (Optional[int]): Идентификатор чата, куда добавлен бот. + chat_id (int): Идентификатор чата, куда добавлен бот. user (User): Объект пользователя-бота. + is_channel (bool): Указывает, был ли бот добавлен в канал или нет """ - chat_id: Optional[int] = None + chat_id: int user: User + is_channel: bool if TYPE_CHECKING: bot: Optional[Bot] diff --git a/maxapi/types/updates/bot_removed.py b/maxapi/types/updates/bot_removed.py index 2bb0811..50812b3 100644 --- a/maxapi/types/updates/bot_removed.py +++ b/maxapi/types/updates/bot_removed.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, Any, Optional +from typing import TYPE_CHECKING, Optional from .update import Update @@ -14,12 +14,14 @@ class BotRemoved(Update): Обновление, сигнализирующее об удалении бота из чата. Attributes: - chat_id (Optional[int]): Идентификатор чата, из которого удалён бот. + chat_id (int): Идентификатор чата, из которого удалён бот. user (User): Объект пользователя-бота. + is_channel (bool): Указывает, был ли пользователь добавлен в канал или нет """ - chat_id: Optional[int] = None + chat_id: int user: User + is_channel: bool if TYPE_CHECKING: bot: Optional[Bot] diff --git a/maxapi/types/updates/user_added.py b/maxapi/types/updates/user_added.py index c9742dd..5bfdd5e 100644 --- a/maxapi/types/updates/user_added.py +++ b/maxapi/types/updates/user_added.py @@ -11,14 +11,16 @@ class UserAdded(Update): Класс для обработки события добавления пользователя в чат. Attributes: - inviter_id (Optional[int]): Идентификатор пользователя, добавившего нового участника. Может быть None. - chat_id (Optional[int]): Идентификатор чата. Может быть None. + inviter_id (int): Идентификатор пользователя, добавившего нового участника. Может быть None. + chat_id (int): Идентификатор чата. Может быть None. user (User): Объект пользователя, добавленного в чат. + is_channel (bool): Указывает, был ли пользователь добавлен в канал или нет """ inviter_id: Optional[int] = None - chat_id: Optional[int] = None + chat_id: int user: User + is_channel: bool def get_ids(self): diff --git a/maxapi/types/updates/user_removed.py b/maxapi/types/updates/user_removed.py index 19f642c..1f6e12b 100644 --- a/maxapi/types/updates/user_removed.py +++ b/maxapi/types/updates/user_removed.py @@ -12,13 +12,15 @@ class UserRemoved(Update): Attributes: admin_id (Optional[int]): Идентификатор администратора, удалившего пользователя. Может быть None. - chat_id (Optional[int]): Идентификатор чата. Может быть None. + chat_id (int): Идентификатор чата. Может быть None. user (User): Объект пользователя, удаленного из чата. + is_channel (bool): Указывает, был ли пользователь удален из канала или нет """ admin_id: Optional[int] = None - chat_id: Optional[int] = None + chat_id: int user: User + is_channel: bool def get_ids(self):