Advertisement
l1von

s

Jun 16th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.51 KB | None | 0 0
  1. async def process():
  2.     x = await client.send_message('AnonRuBot', '/start')
  3.     await asyncio.sleep(2)
  4.     result = await client.get_messages(entity='@AnonRuBot', ids=x.id + 1)
  5.     if hasattr(result, "message") and 'Если не хотите' in result.message:
  6.         s = await client.send_message('AnonRuBot', f'{random.randint(9, 99)}')
  7.         await asyncio.sleep(2)
  8.         res = await client.get_messages(entity='@AnonRuBot', ids=s.id + 2)
  9.         if hasattr(result, "message") and 'Собеседник найден' in res.message:
  10.             while True:
  11.                 await asyncio.sleep(3)
  12.                 await client.send_message('AnonRuBot', text)
  13.                 await asyncio.sleep(2)
  14.                 await client.send_message('AnonRuBot', '/next')
  15.         else:
  16.             while True:
  17.                 await asyncio.sleep(2)
  18.                 await client.send_message('AnonRuBot', '/next')
  19.                 await client.send_message('AnonRuBot', text)
  20.     else:
  21.         while True:
  22.             await asyncio.sleep(3)
  23.             await client.send_message('AnonRuBot', text)
  24.             await asyncio.sleep(2)
  25.             await client.send_message('AnonRuBot', '/next')
  26. with client:
  27.     client.loop.run_until_complete(process())
  28.  
  29. async def processtwo():
  30.     x = await client2.send_message('AnonRuBot', '/start')
  31.     await asyncio.sleep(2)
  32.     result = await client2.get_messages(entity='@AnonRuBot', ids=x.id + 1)
  33.     if hasattr(result, "message") and 'Если не хотите' in result.message:
  34.         s = await client2.send_message('AnonRuBot', f'{random.randint(9, 99)}')
  35.         await asyncio.sleep(2)
  36.         res = await client2.get_messages(entity='@AnonRuBot', ids=s.id + 2)
  37.         if hasattr(result, "message") and 'Собеседник найден' in res.message:
  38.             while True:
  39.                 await asyncio.sleep(3)
  40.                 await client2.send_message('AnonRuBot', text)
  41.                 await asyncio.sleep(2)
  42.                 await client2.send_message('AnonRuBot', '/next')
  43.         else:
  44.             while True:
  45.                 await asyncio.sleep(2)
  46.                 await client2.send_message('AnonRuBot', '/next')
  47.                 await client2.send_message('AnonRuBot', text)
  48.     else:
  49.         while True:
  50.             await asyncio.sleep(3)
  51.             await client2.send_message('AnonRuBot', text)
  52.             await asyncio.sleep(2)
  53.             await client2.send_message('AnonRuBot', '/next')
  54. with client2:
  55.     client2.loop.run_until_complete(processtwo())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement