运行电报b

2024-04-25 21:53:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我在试着运行电报机器人

import telebot
from telebot import apihelper

apihelper.proxy = {"http": "http://{}".format(proxy)}
bot = telebot.TeleBot(config.token)

@bot.message_handler(content_types=["text"])
def repeating_message(message):
    bot.send_message(message.chat.id, message.text)


if __name__ == "__main__":
    bot.polling(none_stop=True)

但它又回来了

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url

我怎样才能避免呢?我试过使用GitHub的所有案例,但都不起作用。你知道吗


Tags: textfromimporttokenconfigformathttpmessage

热门问题