и хочу чтобы после того как нажималась кнопка, выходила другая клавиатура и другая функция прописанная мной. Пробовал if но не выходила клавиатура# -*- coding: utf-8 -*-
import telebot import config
from telebot import types
bot = telebot.TeleBot(config.token)
@bot.message_handler(commands=["start"])
def startKBoard(message):
startKBoard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=True)
Catalog = types.KeyboardButton(text="Каталог")
Info = types.KeyboardButton(text="Инофрмация")
startKBoard.add(Catalog, Info)
bot.send_message(message.chat.id, "Добро пожаловать в магазин цифровых товаров", re>
@bot.message_handler(content_types=['text'])
def catalogchk(message):
if message.text == "Каталог":
def catalogKBoard(message):
catalogKBoard = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
Steam = types.KeyboardButton(text="Steam")
Origin = types.KeyboardButton(text="Origin")
UPlay = types.KeyboardButton(text="UPlay")
EpicGames = types.KeyboardButton(text="Epic Games")
VPN = types.KeyboardButton(text="VPN")
catalogKBoard.add(Steam, Origin, UPlay, EpicGames, VPN)
bot.send_message(message.chat.id, "Выберите Раздел")
if __name__ == '__main__':
bot.infinity_polling() помогите @bot.message_handler(content_types=['text'])
def catalogchk(message):
if message.text == "Каталог":
catalogKBoard = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
Steam = types.KeyboardButton(text="Steam")
Origin = types.KeyboardButton(text="Origin")
UPlay = types.KeyboardButton(text="UPlay")
EpicGames = types.KeyboardButton(text="Epic Games")
VPN = types.KeyboardButton(text="VPN")
catalogKBoard.add(Steam, Origin, UPlay, EpicGames, VPN)
bot.send_message(message.chat.id, "Выберите Раздел", reply_markup=catalogKBoard)def start_keyboard():
keyboard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=True)
Catalog = types.KeyboardButton(text="Каталог")
Info = types.KeyboardButton(text="Инофрмация")
keyboard.add(Catalog, Info)
return keyboard
def catalog_keyboard():
keyboard = types.ReplyKeyboardMarkup(row_width=1, resize_keyboard=True)
Steam = types.KeyboardButton(text="Steam")
Origin = types.KeyboardButton(text="Origin")
UPlay = types.KeyboardButton(text="UPlay")
EpicGames = types.KeyboardButton(text="Epic Games")
VPN = types.KeyboardButton(text="VPN")
keyboard.add(Steam, Origin, UPlay, EpicGames, VPN)
return keyboard bot.send_message(message.chat.id, "Сообщение", reply_markup=catalog_keyboard())