eternnoir / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
8.02k stars 2.02k forks source link

Why did I set up an http proxy and this proxy is available, here is my code #2207

Closed 2622594863 closed 5 months ago

2622594863 commented 5 months ago

Why did I set up an http proxy and this proxy is available, here is my code

import telebot from telebot import apihelper

apihelper.ENABLE_MIDDLEWARE = True apihelper.proxy = {'http': 'http://127.0.0.1:7890'}

bot = telebot.TeleBot("5292619197:AAGWyQteqHXiB6v1yFVOML", parse_mode=None) print(bot.get_me())

mikiyas-girma commented 5 months ago

could you elaborate your issue more

2622594863 commented 5 months ago

could you elaborate your issue more

Of course, because I can't access Telegram directly in Chinese Mainland, I need to use a proxy to connect to it. According to my code, I used the proxy 127.0.0.1:7890, but I still can't connect to Telegram. I can guarantee that my proxy is available

coder2020official commented 5 months ago

any errors