Answer the question
In order to leave comments, you need to log in
How to properly upload tg bot on python to heroku?
Hello, please tell me why when I upload the code to Heroku, it says, they say, Build succeeded, but the bot does not respond, although the code is working. When I tried to write a regular get request, it is also silent, so it's not the telegram api, please help, maybe something is wrong in my code, and it just doesn't work.
code :
import telebot
bot = telebot.TeleBot(TOKEN)
upd = bot.get_updates()
last_upd = upd[-1]
@bot.message_handler(content_types=['text'])
def handle_text(message):
print(message.text )
if message.text == "how are u man?":
bot.send_message(message.chat.id, "normalno bro")
else:
bot.send_message(message.chat.id, "dont write here anymore")
bot.polling(none_stop=True, interval=0)
I specified the token in the heroku itself, it should work...
Answer the question
In order to leave comments, you need to log in
Do not through polling, but with the help of a webhook. Faced the same
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question