mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-10-30 08:12:14 +00:00
change bot import in server.py Added index route
This commit is contained in:
@@ -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
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user