Visitar URL original
Remove "bot" property from UserStatus · ryuuzake/pyrogram@c9ce188 · GitHub
Skip to content

Commit c9ce188

Browse files
committed
Remove "bot" property from UserStatus
1 parent 69c1532 commit c9ce188

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎pyrogram/client/ext/utils.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def parse_chat_photo(photo):
130130

131131

132132
def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus:
133+
if user.bot:
134+
return None
135+
133136
status = user.status
134137
last_seen = pyrogram_types.UserStatus()
135138

@@ -145,8 +148,6 @@ def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus:
145148
last_seen.within_week = True
146149
elif isinstance(status, types.UserStatusLastMonth):
147150
last_seen.within_month = True
148-
elif user.bot:
149-
last_seen.bot = True
150151
else:
151152
last_seen.long_time_ago = True
152153

‎pyrogram/client/types/user_and_chats/user_status.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def __init__(
3333
within_week: bool = None,
3434
within_month: bool = None,
3535
long_time_ago: bool = None,
36-
bot: bool = None,
3736
date: int = None,
3837
):
3938
self.online = online
@@ -42,5 +41,4 @@ def __init__(
4241
self.within_week = within_week
4342
self.within_month = within_month
4443
self.long_time_ago = long_time_ago
45-
self.bot = bot
4644
self.date = date

0 commit comments

Comments
 (0)