Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pyrogram.raw.functions import messages
- from pyrogram.raw.types import InputMessagesFilterEmpty
- from pyrogram.utils import parse_messages
- async def get_my_first_msg(client, chat_id):
- r = await client.invoke(
- messages.Search(
- peer=await client.resolve_peer(chat_id),
- q='',
- filter=InputMessagesFilterEmpty(),
- min_date=0,
- max_date=0,
- offset_id=1,
- add_offset=-1,
- limit=1,
- min_id=0,
- max_id=0,
- from_id=await client.resolve_peer('me'),
- hash=0,
- )
- )
- return (await parse_messages(client, r, replies=0))[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement