mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Remove "bot" property from UserStatus
This commit is contained in:
parent
69c1532eae
commit
c9ce188bbe
@ -130,6 +130,9 @@ def parse_chat_photo(photo):
|
|||||||
|
|
||||||
|
|
||||||
def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus:
|
def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus:
|
||||||
|
if user.bot:
|
||||||
|
return None
|
||||||
|
|
||||||
status = user.status
|
status = user.status
|
||||||
last_seen = pyrogram_types.UserStatus()
|
last_seen = pyrogram_types.UserStatus()
|
||||||
|
|
||||||
@ -145,8 +148,6 @@ def parse_last_seen(user: types.User) -> pyrogram_types.UserStatus:
|
|||||||
last_seen.within_week = True
|
last_seen.within_week = True
|
||||||
elif isinstance(status, types.UserStatusLastMonth):
|
elif isinstance(status, types.UserStatusLastMonth):
|
||||||
last_seen.within_month = True
|
last_seen.within_month = True
|
||||||
elif user.bot:
|
|
||||||
last_seen.bot = True
|
|
||||||
else:
|
else:
|
||||||
last_seen.long_time_ago = True
|
last_seen.long_time_ago = True
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ class UserStatus(Object):
|
|||||||
within_week: bool = None,
|
within_week: bool = None,
|
||||||
within_month: bool = None,
|
within_month: bool = None,
|
||||||
long_time_ago: bool = None,
|
long_time_ago: bool = None,
|
||||||
bot: bool = None,
|
|
||||||
date: int = None,
|
date: int = None,
|
||||||
):
|
):
|
||||||
self.online = online
|
self.online = online
|
||||||
@ -42,5 +41,4 @@ class UserStatus(Object):
|
|||||||
self.within_week = within_week
|
self.within_week = within_week
|
||||||
self.within_month = within_month
|
self.within_month = within_month
|
||||||
self.long_time_ago = long_time_ago
|
self.long_time_ago = long_time_ago
|
||||||
self.bot = bot
|
|
||||||
self.date = date
|
self.date = date
|
||||||
|
Loading…
x
Reference in New Issue
Block a user