A
A
Artem Portnov2019-11-15 18:54:49
Python
Artem Portnov, 2019-11-15 18:54:49

Bot telegram loop not working Process finished with exit code 0 what could be wrong?

Good afternoon, I am writing the first telegram bot for YouTube videos and a question immediately arose. When run, the code is completely executed and exits, although, according to the idea, it should run indefinitely and listen to the chat. What can be wrong? I haven’t rummaged all over, I’ve reviewed all the videos. bot.polling as soon as it did not twist and stuffed it into the if condition, the program ended anyway.
import config
import telebot
from telebot import apihelper
apihelper.proxy = {'https':'socks5://userproxy:[email protected]_address:port'}
bot = telebot.TeleBot(config.token)
@bot.message_handler(commands=[' start', 'help'])
def send_welcome(message):
bot.send_message(message.chat.id, "Hello "
+ message.from_user.first_name + ' '
+ "I'm a bot!")
bot.polling(none_stop=True)
At the end it says: Process finished with exit code 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin The Same, 2019-11-16
@konstantin_tot_samii

You've seen enough of Howdy Ho, now you're clipping bots... The problem is that you don't have vpn, because telegram's IP addresses are blocked in Russia

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question