Advertisement
l1von

Untitled

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