Home>

I wrote a bot, created the menu and the "Back" button, but this button does not work because I do not know how to set the link to the previous menu.

@ Bot.Message_Handler (Commands= ['Plumbing'])
DEF HANDLE_START (Message):
       user_markup= telbot.Types.ReplyKeyboardMarkup (Resize_Keyboard= True)
       user_markup.row ('/back') <
--------------This button is
       User_Markup.row ('Sink', 'Toiletz')
       User_Markup.row ('Bidet')
       Bot.Send_Message (Message.From_USER.ID, 'select the', Reply_markup= User_Markup)

This is my submenu. If you click on the "Sink" command, the bot will send pictures. But if I want to return to the previous menu should be pressed on the "Back" button.

So the question is how to write a code or give a link to the previous menu?

Add a fragment of the code where you have difficulty.

0xdb2021-04-08 00:16:53

This is my submenu. If you click on the "Sink" command, then BOT send pictures. But if I want to return to the previous menu, you must click on the "Back" button, so the question is how to write the code or give a link to the previous menu?

Bobur2021-04-08 00:16:53

@ Bot.Message_Handler (Commands= ['Plumbing']) DEF HANDLE_START (Message): User_MarkUp= TELEBOT.Types.ReplyKeyboardMarkup (Resize_Keyboard= True) User_Markup.row ('/Back') <--------------This is the user_markup.row button ('Sink', 'Toiletz') user_markup.row ('Bidet') Bot.Send_Message (message.from_user.id, 'select the', Reply_MarkUp= user_markup)

Bobur2021-04-08 00:16:53

Use the edit button Transport comments to the question.

0xdb2021-04-08 00:16:53

pear.gitbox

Pavel Durmanov2021-04-08 03:24:05