From c9ce188bbe9c898dc1988f9c21b0fdb9ff7a7f6d Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 14 Oct 2018 17:56:10 +0200 Subject: [PATCH] Remove "bot" property from UserStatus --- pyrogram/client/ext/utils.py | 5 +++-- pyrogram/client/types/user_and_chats/user_status.py | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index 5c80264b..15db2e73 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -130,6 +130,9 @@ def parse_chat_photo(photo): def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus: + if user.bot: + return None + status = user.status last_seen = pyrogram_types.UserStatus() @@ -145,8 +148,6 @@ def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus: last_seen.within_week = True elif isinstance(status, types.UserStatusLastMonth): last_seen.within_month = True - elif user.bot: - last_seen.bot = True else: last_seen.long_time_ago = True diff --git a/pyrogram/client/types/user_and_chats/user_status.py b/pyrogram/client/types/user_and_chats/user_status.py index bb42dc45..90399f43 100644 --- a/pyrogram/client/types/user_and_chats/user_status.py +++ b/pyrogram/client/types/user_and_chats/user_status.py @@ -33,7 +33,6 @@ class UserStatus(Object): within_week: bool = None, within_month: bool = None, long_time_ago: bool = None, - bot: bool = None, date: int = None, ): self.online = online @@ -42,5 +41,4 @@ class UserStatus(Object): self.within_week = within_week self.within_month = within_month self.long_time_ago = long_time_ago - self.bot = bot self.date = date