change bot import in server.py Added index route

This commit is contained in:
2022-05-15 17:23:56 +03:00
parent 7d6f6035ea
commit c3ace838b9
2 changed files with 6 additions and 3 deletions
+6 -1
View File
@@ -1,13 +1,18 @@
import flask
import telebot
from .bot import bot
from bot import bot
app = flask.Flask(__name__)
WEBHOOK_URL_PATH = "/{}".format(bot.token)
@app.route("/")
def index():
return "<h1>Index page</h1>"
@app.route(WEBHOOK_URL_PATH, methods=["POST"])
def webhook():
if flask.request.headers.get("content-type") == "application/json":