randydev commited on
Commit
d230be6
·
verified ·
1 Parent(s): 53062f9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +21 -2
main.py CHANGED
@@ -80,15 +80,34 @@ async def get_user_story(link: str = None):
80
  async def get_chat_raw(username: str = None):
81
  try:
82
  chat_raw = (await client.get_chat(username)).raw
 
83
  except Exception:
84
  return {"error": "Error try again invalid"}
85
  return {
86
  "id": chat_raw.id,
87
  "about": chat_raw.about,
88
- "chat_photo": {
 
 
89
  "id": chat_raw.chat_photo.id,
 
 
 
 
90
  "date": chat_raw.chat_photo.date,
91
- "dc_id": chat_raw.chat_photo.dc_id
 
 
 
 
 
 
 
 
 
 
 
 
92
  },
93
  "can_view_participants": chat_raw.can_view_participants,
94
  "can_set_username": chat_raw.can_set_username,
 
80
  async def get_chat_raw(username: str = None):
81
  try:
82
  chat_raw = (await client.get_chat(username)).raw
83
+ chat_ = await client.get_chat(username)
84
  except Exception:
85
  return {"error": "Error try again invalid"}
86
  return {
87
  "id": chat_raw.id,
88
  "about": chat_raw.about,
89
+ "title": chat_.title,
90
+ "username": chat_.username,
91
+ "photo": {
92
  "id": chat_raw.chat_photo.id,
93
+ "small_file_id": chat_.photo.small_file_id,
94
+ "small_photo_unique_id": chat_.photo.small_photo_unique_id,
95
+ "big_file_id": chat_.photo.big_file_id,
96
+ "big_photo_unique_id": chat_.photo.big_photo_unique_id,
97
  "date": chat_raw.chat_photo.date,
98
+ "dc_id": chat_raw.chat_photo.dc_id,
99
+ "has_animation": chat_.photo.has_animation,
100
+ "is_personal": chat_.photo.is_personal
101
+ },
102
+ "from_user": {
103
+ "id": chat_.pinned_message.from_user.id,
104
+ "first_name": chat_.pinned_message.from_user.first_name,
105
+ "last_name": chat_.pinned_message.from_user.last_name,
106
+ "status": chat_.pinned_message.from_user.status.name,
107
+ "last_online_date": chat_.pinned_message.from_user.last_online_date,
108
+ "username": chat_.pinned_message.from_user.username,
109
+ "is_premium": chat_.pinned_message.from_user.is_premium,
110
+ "is_scam": chat_.pinned_message.from_user.is_scam
111
  },
112
  "can_view_participants": chat_raw.can_view_participants,
113
  "can_set_username": chat_raw.can_set_username,