Answer the question
In order to leave comments, you need to log in
I'm trying to create a simple echo-telegram bot. Gives an error message. What to do?
I tried to create a simple telegram bot through Python. I know that Telegram was blocked in Russia. I even used a proxy, but it still didn't help. Writes at the end: AttributeError: 'set' object has no attribute 'get'.
The program itself:
import telebot
from telebot import apihelper
apihelper. proxy = {'https://85.132.71.82:3128'}
bot = telebot. TeleBot( ' мой токен')
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message) :
bot.send_message(message.chat.id, message. text)
if__name__== '__main__' :
bot. polling(none_stop=True)
Answer the question
In order to leave comments, you need to log in
You are not specifying the proxy correctly.
Need like this:
apihelper.proxy = {'https':'45.77.101.237:8080'}
#apihelper.proxy = {'https':'IP:PORT'}
.ConnectTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question