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
-2
View File
@@ -14,8 +14,6 @@ bot.set_webhook(
os.getenv("PROJECT_NAME"), os.getenv("TELEGRAM_TOKEN")
)
)
print(os.getenv("PROJECT_NAME"))
print(os.getenv("TELEGRAM_TOKEN"))
@bot.message_handler(commands=["start"])
+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":