Здравствуйте. Нужно добиться переключения функций после цепочки if-elif-else. Пример кода:
@bot.message_handler(content_types=['text'])
def EN(message):
if (message.text == "EN"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "EN", reply_markup=markup)
elif (message.text == "Choose category"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item111 = types.KeyboardButton("History")
item112 = types.KeyboardButton("Science")
item113 = types.KeyboardButton("Arts")
item114 = types.KeyboardButton("Back")
markup.add(item111,item112,item113,item114)
bot.send_message(message.chat.id,text = "Choose category", reply_markup=markup)
elif (message.text == "FAQ"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item122 = types.KeyboardButton("Back")
markup.add(item122)
text = """Text about TOP-7 questions"""
bot.send_message(message.chat.id,text,parse_mode = 'MarkdownV2',reply_markup=markup)
elif (message.text == "Payment instructions"):
markup = types.InlineKeyboardMarkup()
item141 = types.InlineKeyboardButton("Binance", url = 'https://www.binance.com/en/support/faq/c-2?navId=2')
item142 = types.InlineKeyboardButton("BlockChain",url = 'https://support.blockchain.com/hc/en-us/sections/4517566823060-Deposits-and-Withdrawals')
item143 = types.InlineKeyboardButton("TrustWallet",url = 'https://community.trustwallet.com/t/how-to-create-a-payment-request/23332')
markup.add(item141,item142,item143)
bot.send_message(message.chat.id,text = "Choose your Wallet", reply_markup=markup)
elif (message.text == "Back"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
item11 = types.KeyboardButton("Choose category")
item12 = types.KeyboardButton("FAQ")
item13 = types.KeyboardButton("About")
item14 = types.KeyboardButton("Payment instructions")
item15 = types.KeyboardButton("Back")
markup.add(item11,item12,item13,item14,item15)
bot.send_message(message.chat.id,text = "You returned to the menu", reply_markup=markup)
else:
return RU
(Если что - после else стоит возврат аргумента следующей функции).
Как добиться переключения функций?