diff --git a/src/bot.py b/src/bot.py index 22e5be7..1ff003e 100644 --- a/src/bot.py +++ b/src/bot.py @@ -8,9 +8,12 @@ load_dotenv() bot = telebot.TeleBot(os.getenv("TELEGRAM_TOKEN")) +# remove previous webhook +bot.remove_webhook() + # configure the webhook for the bot bot.set_webhook( - "https://{}.herokuapp.com/{}".format( + "https://{}.herokuapp.com/{}/".format( os.getenv("PROJECT_NAME"), os.getenv("TELEGRAM_TOKEN") ) ) diff --git a/src/server.py b/src/server.py index 21c3f21..9cfcf81 100644 --- a/src/server.py +++ b/src/server.py @@ -10,12 +10,12 @@ app = flask.Flask(__name__) WEBHOOK_URL_PATH = "/{}".format(bot.token) -@app.route("/") +@app.route("/", methods=["GET"]) def index(): return "