S
S
Sasha2020-11-18 21:33:59
Python
Sasha, 2020-11-18 21:33:59

Python code for telegrama?

I wrote a simple code that repeats everything and for it to work you need to activate the code (and it turns off after 3-5 minutes). I want to run forever and that it doesn't turn off. Is it possible to?

import telebot
import config

bot = telebot.TeleBot(config.TOKEN)

@bot.message_handler(content_types=['text'])
def lalala(message):
  bot.send_message(message.chat.id, message.text)

#RUN
bot.polling(none_stop=True)

(config key there)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SHADRIN, 2020-11-19
@shadrin_ss

if __name__ == '__main__':
    bot.polling(none_stop=True)

Replace the last line with this
And if it doesn't help, describe in more detail what's going on...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question