M
M
maxshkiv2018-10-30 21:44:51
Python
maxshkiv, 2018-10-30 21:44:51

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

2 answer(s)
H
Helow19274, 2018-10-30
@Helow19274

Do not through polling, but with the help of a webhook. Faced the same

S
sound901, 2018-10-31
@saund901

buy the cheapest (about 100 rubles) vps and play

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question