Captain Ezio commited on
Commit
f87a0c5
·
1 Parent(s): 92b81e1

Update info.py

Browse files
Files changed (1) hide show
  1. Powers/plugins/info.py +17 -18
Powers/plugins/info.py CHANGED
@@ -98,25 +98,24 @@ async def user_info(c: Gojo, user, already=False):
98
  is_bot = user.is_bot
99
  is_fake = user.is_fake
100
  status = user.status
101
-
102
  if is_bot is True:
103
- last_date = "Targeted user is a bot"
104
- elif status == "recently":
105
- last_date = "Last seen Recently"
106
- elif status == "within_week":
107
- last_date = "Last seen within the last week"
108
- elif status == "within_month":
109
- last_date = "Last seen within the last month"
110
- elif status == "long_time_ago":
111
- last_date = "Last seen a long time ago or may be I am blocked by the user :("
112
- elif status == "online":
113
- last_date = "User is currently Online"
114
- elif status == "offline":
115
- last_date = datetime.fromtimestamp(user.status.date).strftime(
116
- "%Y-%m-%d %H:%M:%S"
117
- )
118
- else:
119
- last_date = "User is currently online"
120
 
121
  caption = f"""
122
  <b><i><u>⚡️ Extracted User info From Telegram ⚡️</b></i></u>
 
98
  is_bot = user.is_bot
99
  is_fake = user.is_fake
100
  status = user.status
101
+ last_date = "Unable to fetch"
102
  if is_bot is True:
103
+ last_date = "Targeted user is a bot"
104
+ if status == enums.UserStatus.RECENTLY:
105
+ last_date = "User was seen recently"
106
+ if status == enums.UserStatus.LAST_WEEK:
107
+ last_date = "User was seen last week"
108
+ if status == enums.UserStatus.LAST_MONTH:
109
+ last_date = "User was seen last month"
110
+ if status == enums.UserStatus.LONG_AGO:
111
+ last_date = "User was seen long ago or may be I am blocked by the user :("
112
+ if status == enums.UserStatus.ONLINE:
113
+ last_date = "User is online"
114
+ if status == enums.UserStatus.OFFLINE:
115
+ try:
116
+ last_date = datetime.fromtimestamp(user.status.date).strftime("%Y-%m-%d %H:%M:%S")
117
+ except Exception as e:
118
+ last_date = "User is offline"
 
119
 
120
  caption = f"""
121
  <b><i><u>⚡️ Extracted User info From Telegram ⚡️</b></i></u>