Answer the question
In order to leave comments, you need to log in
Error when starting a telegram bot in python. How to decide?
The code:
# art
import telebot
bot = telebot.TeleBot("здесь токен")
bot.send_message(394970516, "text")
Answer the question
In order to leave comments, you need to log in
As Pavel Denisov already wrote here , the problem is blocking telegram on the territory of the Russian Federation. You can try to use VPS in a foreign data center. I, in order to play around with the telegram bot API, used the openshift platform ( https://www.openshift.com/ ), there is a free use option. How to "hide" the token in an environment variable when using openshit can be read here: How to hide the telegram bot token when the repository is open on github and hosted on openshift?
Hello everyone) Faced the same problem, only the cart is already unlocked in Russia)
Connect through a proxy.
For example:
import telebot
from telebot import apihelper
access_token = '***'
apihelper.proxy = {'https': ' https://85.132.71.82:3128 '}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question