Answer the question
In order to leave comments, you need to log in
Why can't python see the call variable?
telebot
library : https://github.com/eternnoir/pyTelegramBotAPI
elif message.text == "Каталог":
bot.send_message(message.chat.id, "⬇️Каталог игр:", reply_markup=keyboard2)
bot.register_next_step_handler(message, catalog)
def catalog(message):
if message.text == "Не нашёл свою игру?":
bot.send_message(message.chat.id, "Обратитесь в поддержку\nПоддержка 24/7 - @flex7r")
elif message.text == "⬅️Назад":
bot.send_message(message.chat.id, "Главное меню", reply_markup=keyboard1)
bot.register_next_step_handler(message, main)
else:
try:
keyboard = types.InlineKeyboardMarkup()
callback_button = types.InlineKeyboardButton(text="Купить", callback_data="test")
keyboard.add(callback_button)
catalogvar = c.games_list.index(message.text)
bot.send_photo(message.chat.id, c.games_photo[catalogvar], c.games_list[catalogvar] + "\nЦена: " + str(c.games_price[catalogvar]) + " руб.", reply_markup=keyboard)
if call.data == "test":
bot.send_message(message.chat.id, "success")
except ValueError:
bot.send_message(message.chat.id, "Игра не найдена")
bot.register_next_step_handler(message, catalog)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question