@BMinhoj

Почему не компилируется бот на Python?

Ошибка Connection pool of Request object is smaller than optimal value (8)
from telegram import Bot
from telegram import Update
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler
from telegram.ext import Filters
from config import TG_TOKEN


def start_function(bot: Bot, update: Update):
    bot.send_message(
        chat_id = update.message.chat_id,
        text = "Привет",
    )

def show_text(bot: Bot, update: Update):
    text = update.message.text
    bot.send_message(
        chat_id = update.message.chat_id,
        text = text,
    )
def main():
    bot = Bot(token = TG_TOKEN,)
    updater = Updater(bot = bot)
    start_handler = CommandHandler('start', start_function)
    message_handler = MessageHandler(Filters.text, show_text)

    updater.dispatcher.add_handler(start_handler)
    updater.dispatcher.add_handler(message_handler)

    updater.start_polling()
    updater.idle()

if __name__ == '__main__':
    main()
  • Вопрос задан
  • 254 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы