Advertisement
disk6969

pyro reverse search_messages

Jul 8th, 2024 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from pyrogram.raw.functions import messages
  2. from pyrogram.raw.types import InputMessagesFilterEmpty
  3. from pyrogram.utils import parse_messages
  4.  
  5.  
  6. async def get_my_first_msg(client, chat_id):
  7.     r = await client.invoke(
  8.         messages.Search(
  9.             peer=await client.resolve_peer(chat_id),
  10.             q='',
  11.             filter=InputMessagesFilterEmpty(),
  12.             min_date=0,
  13.             max_date=0,
  14.             offset_id=1,
  15.             add_offset=-1,
  16.             limit=1,
  17.             min_id=0,
  18.             max_id=0,
  19.             from_id=await client.resolve_peer('me'),
  20.             hash=0,
  21.         )
  22.     )
  23.     return (await parse_messages(client, r, replies=0))[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement