Advertisement
disk6969

Untitled

Sep 9th, 2024
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. async def get_join_requests(chat_id):
  2.     date = 0
  3.     user = types.InputUserEmpty()
  4.  
  5.     while True:
  6.         r = await client(
  7.             functions.messages.GetChatInviteImportersRequest(
  8.                 peer=chat_id,
  9.                 limit=100,
  10.                 offset_date=date,
  11.                 offset_user=user,
  12.                 requested=True,
  13.             )
  14.         )
  15.  
  16.         if not r.importers:
  17.             break
  18.  
  19.         date, user = r.importers[-1].date, r.importers[-1].user_id
  20.  
  21.         for i in r.importers:
  22.             # do action to i.user_id or yield them somewhere else
  23.  
  24.         # sleep a bit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement