Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
·
d90dabe
1
Parent(s):
61ca439
Minor changes
Browse files- Powers/plugins/info.py +11 -4
Powers/plugins/info.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
from pyrogram import enums
|
| 3 |
from datetime import datetime
|
| 4 |
from traceback import format_exc
|
|
@@ -204,11 +205,14 @@ async def info_func(c: Gojo, message: Message):
|
|
| 204 |
return await m.edit(str(e))
|
| 205 |
|
| 206 |
if not photo_id:
|
| 207 |
-
|
|
|
|
|
|
|
| 208 |
photo = await c.download_media(photo_id)
|
| 209 |
|
| 210 |
-
await message.reply_photo(photo, caption=info_caption, quote=False)
|
| 211 |
await m.delete()
|
|
|
|
|
|
|
| 212 |
os.remove(photo)
|
| 213 |
LOGGER.info(
|
| 214 |
f"{message.from_user.id} fetched user info of user {user_name} in {m.chat.id}"
|
|
@@ -239,15 +243,18 @@ async def chat_info_func(c: Gojo, message: Message):
|
|
| 239 |
|
| 240 |
info_caption, photo_id = await chat_info(c, chat=chat)
|
| 241 |
if not photo_id:
|
| 242 |
-
|
|
|
|
|
|
|
| 243 |
|
| 244 |
photo = await c.download_media(photo_id)
|
|
|
|
|
|
|
| 245 |
await message.reply_photo(photo, caption=info_caption, quote=False)
|
| 246 |
LOGGER.info(
|
| 247 |
f"{message.from_user.id} fetched chat info of chat {chat} in {message.chat.id}"
|
| 248 |
)
|
| 249 |
|
| 250 |
-
await m.delete()
|
| 251 |
os.remove(photo)
|
| 252 |
except Exception as e:
|
| 253 |
await message.reply_text(text=e)
|
|
|
|
| 1 |
import os
|
| 2 |
+
from asyncio import sleep
|
| 3 |
from pyrogram import enums
|
| 4 |
from datetime import datetime
|
| 5 |
from traceback import format_exc
|
|
|
|
| 205 |
return await m.edit(str(e))
|
| 206 |
|
| 207 |
if not photo_id:
|
| 208 |
+
await m.delete()
|
| 209 |
+
sleep(2)
|
| 210 |
+
return await message.reply_text(info_caption, disable_web_page_preview=True)
|
| 211 |
photo = await c.download_media(photo_id)
|
| 212 |
|
|
|
|
| 213 |
await m.delete()
|
| 214 |
+
sleep(2)
|
| 215 |
+
await message.reply_photo(photo, caption=info_caption, quote=False)
|
| 216 |
os.remove(photo)
|
| 217 |
LOGGER.info(
|
| 218 |
f"{message.from_user.id} fetched user info of user {user_name} in {m.chat.id}"
|
|
|
|
| 243 |
|
| 244 |
info_caption, photo_id = await chat_info(c, chat=chat)
|
| 245 |
if not photo_id:
|
| 246 |
+
await m.delete()
|
| 247 |
+
sleep(2)
|
| 248 |
+
return await message.reply_text(info_caption, disable_web_page_preview=True)
|
| 249 |
|
| 250 |
photo = await c.download_media(photo_id)
|
| 251 |
+
await m.delete()
|
| 252 |
+
sleep(2)
|
| 253 |
await message.reply_photo(photo, caption=info_caption, quote=False)
|
| 254 |
LOGGER.info(
|
| 255 |
f"{message.from_user.id} fetched chat info of chat {chat} in {message.chat.id}"
|
| 256 |
)
|
| 257 |
|
|
|
|
| 258 |
os.remove(photo)
|
| 259 |
except Exception as e:
|
| 260 |
await message.reply_text(text=e)
|