Зачем вы делаете функцию внутри функции?
Сделайте так
@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())