TelegramAktienBot/webservice/app.py

26 lines
447 B
Python
Raw Normal View History

2022-03-12 18:44:58 +00:00
import multiprocessing as mp
import time
2022-03-08 14:11:39 +00:00
from flask import Flask
from telegram_bot.bot import bot
2022-03-12 18:44:58 +00:00
2022-03-08 14:11:39 +00:00
app = Flask(__name__)
@app.route('/')
2022-03-12 18:44:58 +00:00
def hello_world():
2022-03-08 14:11:39 +00:00
return 'Hello World!'
if __name__ == '__main__':
2022-03-12 18:44:58 +00:00
proc1 = mp.Process(target=app.run, args=())
proc1.start()
while True:
try:
bot.polling(none_stop=True)
except Exception as e:
print(f"[EXCEPTION] {e}")
time.sleep(15)