import telebot
from telebot import apihelper
TOKEN = '836764194:AAHd4h Kv1HVvIl1g'
apihelper.proxy = {'http':'http://171.255.192.118:8080'}
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
sent = bot.send_message(message.chat.id, 'Как тебя зовут?')
bot.polling()
import telebot
from telebot import apihelper
bot = telebot.TeleBot(TOKEN)
apihelper.proxy = {'https': 'socks5h://user:password@IP:1080'}
<...>
If you want to use socket5 proxy you need install dependency pip install requests[socks] and make sure, that you have the latest version of gunicorn, PySocks, pyTelegramBotAPI, requests and urllib3