-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
38 lines (25 loc) · 784 Bytes
/
run.py
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
import thread
from telegamAnswer import TelegramAnswer
from whatappAnswer import whatsappAnswer
import layer
from threading import Thread
layer.telegram_answer = TelegramAnswer()
def run_telegram(a):
print ("run_telegram")
layer.telegram_answer.connect()
layer.telegram_answer.send_main_session()
layer.telegram_answer.recieve_message()
def run_whatsapp(a):
w = whatsappAnswer()
stack = w.create_stack()
layer.telegram_answer.set_stack(stack)
w.receive_message(stack)
def loop_whatsapp(a):
w_thread = Thread(target=run_whatsapp, args=(0, ))
w_thread.start()
w_thread.join()
if __name__ == "__main__":
thread.start_new_thread(run_telegram, (0,))
thread.start_new_thread(loop_whatsapp, (0,))
while True:
pass