File size: 2,251 Bytes
6f21999
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from telethon import TelegramClient, events, sync
import re

api_id = '20878410'
api_hash = '9f9a160a0031c089557b7502b04862a7'
regex = r"BTC_ROKET_BOT\?start="

client = TelegramClient('session', api_id, api_hash)
@client.on(events.NewMessage())
async def normal_handler(event):
    user_mess = event.message.to_dict()['message']
    m_from = event.message.to_dict()
    to_id = event.message.to_dict()

    if re.search(r'BTC_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('BTC_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'ETH_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('ETH_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'TETHER_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('TETHER_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'LTC_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('LTC_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'DOGE_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('DOGE_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'DASH_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('DASH_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'MCR_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('MCR_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'MDT_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('MDT_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))
    if re.search(r'BZ_ROKET_BOT\?start=', user_mess):
        m = re.search(r'c_\S+', user_mess)
        await client.send_message('BZ_ROKET_BOT', '/start ' + m.group(0))
        print(m.group(0))

client.start()
client.run_until_disconnected()