Update main.py
Browse files
main.py
CHANGED
@@ -76,7 +76,56 @@ async def get_user_story(link: str = None):
|
|
76 |
"caption": None
|
77 |
}
|
78 |
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
@fast_app.get("/user/get_user")
|
81 |
async def get_user(user_id=None):
|
82 |
try:
|
|
|
76 |
"caption": None
|
77 |
}
|
78 |
|
79 |
+
@fast_app.get("/user/raw/getchat")
|
80 |
+
async def get_user(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 |
+
"access_hash": chat_raw.chat_photo.access_hash,
|
91 |
+
"file_reference": chat_raw.chat_photo.file_reference,
|
92 |
+
"date": chat_raw.chat_photo.date,
|
93 |
+
"dc_id": chat_raw.chat_photo.dc_id
|
94 |
+
},
|
95 |
+
"can_view_participants": chat_raw.can_view_participants,
|
96 |
+
"can_set_username": chat_raw.can_set_username,
|
97 |
+
"can_set_stickers": chat_raw.can_set_stickers,
|
98 |
+
"hidden_prehistory": chat_raw.hidden_prehistory,
|
99 |
+
"can_set_location": chat_raw.can_set_location,
|
100 |
+
"has_scheduled": chat_raw.has_scheduled,
|
101 |
+
"can_view_stats": chat_raw.can_view_stats,
|
102 |
+
"blocked": chat_raw.blocked,
|
103 |
+
"can_delete_channel": chat_raw.can_delete_channel,
|
104 |
+
"antispam": chat_raw.antispam,
|
105 |
+
"participants_hidden": chat_raw.participants_hidden,
|
106 |
+
"translations_disabled": chat_raw.translations_disabled,
|
107 |
+
"stories_pinned_available": chat_raw.stories_pinned_available,
|
108 |
+
"view_forum_as_messages": chat_raw.view_forum_as_messages,
|
109 |
+
"restricted_sponsored": chat_raw.restricted_sponsored,
|
110 |
+
"can_view_revenue": chat_raw.can_view_revenue,
|
111 |
+
"paid_media_allowed": chat_raw.paid_media_allowed,
|
112 |
+
"can_view_stars_revenue": chat_raw.can_view_stars_revenue,
|
113 |
+
"paid_reactions_available": chat_raw.paid_reactions_available,
|
114 |
+
"stargifts_available": chat_raw.stargifts_available,
|
115 |
+
"participants_count": chat_raw.participants_count,
|
116 |
+
"online_count": chat_raw.online_count,
|
117 |
+
"pinned_msg_id": chat_raw.pinned_msg_id,
|
118 |
+
"linked_chat_id": chat_raw.linked_chat_id,
|
119 |
+
"pending_suggestions": chat_raw.pending_suggestions,
|
120 |
+
"recent_requesters": chat_raw.recent_requesters,
|
121 |
+
"default_send_as": {
|
122 |
+
"user_id": chat_raw.default_send_as.user_id
|
123 |
+
},
|
124 |
+
"available_reactions": {
|
125 |
+
"allow_custom": chat_raw.available_reactions.allow_custom
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
@fast_app.get("/user/get_user")
|
130 |
async def get_user(user_id=None):
|
131 |
try:
|