0

Не могу понять проблему, читал документацию и попытался строчку подогнать под бота, вроде всё правильно, но все равно выходит ошибка. использую telebot и PyTelegramBotAPI P.S. каши из табуляций и пробелов нет

Вывод:

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/bin/pythonanywhere_runner.py", line 26, in _pa_run
   code = compile(f.read(), filename.encode("utf8"), "exec")
 File "/home/bot/bot.py", line 38
   class telebot.types.ForceReply(selective: Optional[bool] = None, input_field_placeholder: Optional[str] = None);
IndentationError: unexpected indent 

Код:

import telebot
import config

from telebot import types

bot = telebot.TeleBot(config.TOKEN)

@bot.message_handler(commands=['start'])
def welcome(message):

    # keyboard
    markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
    item1 = types.KeyboardButton("test")
    item2 = types.KeyboardButton("test2")
 


    markup.add(item1, item2)

    bot.send_message(message.chat.id, "Добро пожаловать".format(message.from_user, bot.get_me()),
        parse_mode='html', reply_markup=markup)

 class telebot.types.ForceReply(selective: Optional[bool] = None, input_field_placeholder: Optional[str] = None)

bot.polling(none_stop=True)
2
  • Что вы вообще хотите сделать? 13 сен 2022 в 19:10
  • force reply хотел сделать 14 сен 2022 в 9:14

2 ответа 2

0

Самостоятельно нашел решение, оказывается нужно было обновить библиотеку pytelegrambotapi.

-1
pip install pytelegrambotapi 

напиши вот это в консоль

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.