How to launch flask and telegram bot at the same time?

68 Views Asked by At

https://github.com/abdullaev388/Telegram-Web-App/blob/master/telebot_webapp/main.py

Here a person starts everything with:

def main():
    bot.delete_webhook()
    bot.set_webhook(config.ServerUrl)
    app.run(host='0.0.0.0', port=80)

if __name__ == '__main__':
    main()

But when:

bot.delete_webhook()
bot.set_webhook(configuration.Server URL)

My bot doesn't start.

Please don't judge me harshly, I'm just getting started. I just don't understand how everything works for him. And even earlier I had Flask as a separate file , but recently I found out that you can run it all together

I used to run it using bot.infinity_polling()

0

There are 0 best solutions below