Answer the question
In order to leave comments, you need to log in
Why does the proxy work in the Telegram client but not in the Python bot?
There is a simple bot in Python for Cart,
import telebot
from telebot import apihelper
token = '' #вписан верный
apihelper.proxy = {'https':'socks5://166.62.43.205:49683'}
bot = telebot.TeleBot(token)
@bot.message_handler(commands=['start'])
def start_message(message):
bot.send_message(message.chat.id, 'Привет, ты написал мне /start')
@bot.message_handler(content_types=['text'])
def send_text(message):
if message.text.lower() == 'привет':
bot.send_message(message.chat.id, 'Привет, создатель')
elif message.text.lower() == 'пока':
bot.send_message(message.chat.id, 'Прощай, создатель')
bot.polling()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question