Мой код
animals = []
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def startt(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True, row_width=2)
btn1 = types.InlineKeyboardButton("Купить семена")
btn3 = types.InlineKeyboardButton("Продать урожай")
btn4 = types.InlineKeyboardButton("Купить питомца")
btn5 = types.InlineKeyboardButton("Моя ферма")
markup.add(btn1, btn3, btn4, btn5)
send = f"Привет {message.from_user.first_name} {message.from_user.last_name}\nНа этом боте ты можешь собирать урожай и зарабатывать на этом"
bot.send_message(message.chat.id, send, parse_mode='html', reply_markup=markup)
@bot.message_handlers(content_types=['text'])
def txt(message):
msg = message.text
if msg == "Купить питомца":
ma = types.ReplyKeyboardMarkup()
b1 = types.InlineKeyboardButton("Купить")
b2 = types.InlineKeyboardButton("Продать")
bot.send_message(message.chat.id, "У вас" + [animals] + "питомцев")
bot.polling(none_stop=True)
Когда запускаю выдает ошибка ('list' object is not callable)
Как это решить?
Вопрос задан
более трёх лет назад
1090 просмотров