you better use inlinekeyboard for both yes/no and the preceding keyboard which you want to show after pressing yes or no. that way, you can edit the yes/no inlinekeyboard message and show new keyboard.
you can send the inlineKeyboard and by checking it's callBackQuery.Data parameter you can edit the sent message again and show your new message instead.
below is a sample update message json:
{"update_id":14603298,
"callback_query":
{
"id": "479899181065761766",
"from": {
"id": 111735238,
"first_name": "eric",
"username": "...."
},
"message": {
"message_id": 22,
"from": {
"id": 3576731383,
"first_name": "the_bot_name",
"username": "mybot_bot"
},
"chat": {
"id": 111745258,
"first_name": "eric",
"username": "....",
"type": "private"
},
"date": 1492113810,
"text": "sent message"
},
"chat_instance": "5419183837652256438",
"data": "yes"
}}
so, when the user clicks on yes or no, you will get an update message. based on above update message, the chatid and messageid are known so using the c# Telegram.Bot library the edit code is like:
var chatid= 111745258;
var messageid=22;
TelegramBotClient api = new TelegramBotClient("YOUR_TOKEN");
var new_keyboard = new InlineKeyboardMarkup(
new[]
{
new[]
{
new InlineKeyboardButton("step_1","step1") ,
},
new[]
{
new InlineKeyboardButton("step_2","step2"),
new InlineKeyboardButton("step_3","step3"),
},
new[]
{
new InlineKeyboardButton("step_4","step4"),
}
});
api.EditMessageReplyMarkupAsync(chatid, messageid, replyMarkup: new_keyboard);