Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- api_id = 12# https://my.telegram.org заходишь и создаешь app
- api_hash = '12' # https://my.telegram.org заходишь и создаешь app
- client = TelegramClient('anon', api_id, api_hash)
- client.connect()
- api_id2 = 12
- api_hash2 = '12'
- client2 = TelegramClient('an', api_id2, api_hash2)
- client2.connect()
- text = input('Введите текст для спама: ')
- async def process():
- x = await client.send_message('AnonRuBot', '/start')
- await asyncio.sleep(2)
- result = await client.get_messages(entity='@AnonRuBot', ids=x.id + 1)
- if hasattr(result, "message") and 'Если не хотите' in result.message:
- s = await client.send_message('AnonRuBot', f'{random.randint(9, 99)}')
- await asyncio.sleep(2)
- res = await client.get_messages(entity='@AnonRuBot', ids=s.id + 2)
- if hasattr(result, "message") and 'Собеседник найден' in res.message:
- while True:
- await asyncio.sleep(3)
- await client.send_message('AnonRuBot', text)
- await asyncio.sleep(2)
- await client.send_message('AnonRuBot', '/next')
- else:
- while True:
- await asyncio.sleep(2)
- await client.send_message('AnonRuBot', '/next')
- await client.send_message('AnonRuBot', text)
- else:
- while True:
- await asyncio.sleep(3)
- await client.send_message('AnonRuBot', text)
- await asyncio.sleep(2)
- await client.send_message('AnonRuBot', '/next')
- with client:
- client.loop.run_until_complete(process())
- async def processtwo():
- x = await client2.send_message('AnonRuBot', '/start')
- await asyncio.sleep(2)
- result = await client2.get_messages(entity='@AnonRuBot', ids=x.id + 1)
- if hasattr(result, "message") and 'Если не хотите' in result.message:
- s = await client2.send_message('AnonRuBot', f'{random.randint(9, 99)}')
- await asyncio.sleep(2)
- res = await client2.get_messages(entity='@AnonRuBot', ids=s.id + 2)
- if hasattr(result, "message") and 'Собеседник найден' in res.message:
- while True:
- await asyncio.sleep(3)
- await client2.send_message('AnonRuBot', text)
- await asyncio.sleep(2)
- await client2.send_message('AnonRuBot', '/next')
- else:
- while True:
- await asyncio.sleep(2)
- await client2.send_message('AnonRuBot', '/next')
- await client2.send_message('AnonRuBot', text)
- else:
- while True:
- await asyncio.sleep(3)
- await client2.send_message('AnonRuBot', text)
- await asyncio.sleep(2)
- await client2.send_message('AnonRuBot', '/next')
- with client2:
- client2.loop.run_until_complete(processtwo())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement