private async Task <bool> RegisterFixStage1(Message msg)
        {
            //check if this user is able to fix SDC

            Chat currChat = msg.Chat;

            InlineKeyboardMarkup kb = new InlineKeyboardMarkup(new[]
            {
                new InlineKeyboardButton[]
                {
                    new InlineKeyboardButton("SDC", "varnameSDC"),
                    new InlineKeyboardButton("TCC", "varnameTCC")
                }
            });

            UserDataFixingDialogs currDialog = new UserDataFixingDialogs()
            {
                origMessage   = msg,
                userID        = msg.Chat.Id,
                userName      = msg.Chat.Username,
                userFirstName = msg.Chat.FirstName,
                userLastName  = msg.Chat.LastName,
                chatTitle     = msg.Chat.Title
            };

            Message sentMsg = await Bot.SendTextMessageAsync(msg.Chat.Id, "Please choose what would you like to fix",
                                                             replyMarkup : kb);

            currDialog.varChoosingMessage = sentMsg;
            lDialogs.Add(currDialog);

            return(true);
        }
        private async void Bot_OnCallbackQuery(object sender, CallbackQueryEventArgs callbackQueryEventArgs)
        {
            CallbackQuery currQuery = callbackQueryEventArgs.CallbackQuery;

            //search for dialog var choosing message
            bool bFoundByVarChoosingMessage =
                lDialogs.Any(dlg => dlg.varChoosingMessage.MessageId == currQuery.Message.MessageId);
            List <UserDataFixingDialogs> lDialogsWithValueRequestMessages =
                lDialogs.Where(dlg => dlg.valueRequestMessage != null).ToList();
            bool bFoundByValueRequestMessage =
                lDialogsWithValueRequestMessages.Any(
                    dlg => dlg.valueRequestMessage.MessageId == currQuery.Message.MessageId);

            if (!bFoundByVarChoosingMessage && !bFoundByValueRequestMessage)
            {
                string replMessage = "Извините, кажется, я все забыл." + Environment.NewLine +
                                     "Попробуйте заново запросить снимок, информацию о нем и исправить эти данные.";
                await Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, replMessage, true, false,
                                               currQuery.Message.MessageId, BasicKeyboard());

                return;
            }

            UserDataFixingDialogs currDialog = null;

            if (bFoundByVarChoosingMessage)
            {
                currDialog =
                    lDialogs.First(
                        dlg => dlg.varChoosingMessage.MessageId == currQuery.Message.MessageId);
            }
            else if (bFoundByValueRequestMessage)
            {
                currDialog =
                    lDialogs.First(
                        dlg => dlg.valueRequestMessage.MessageId == currQuery.Message.MessageId);
            }



            if (currDialog.varname == null)
            {
                if ((currQuery.Data == "varnameSDC") || (currQuery.Data == "varnameTCC"))
                {
                    currDialog.varname = currQuery.Data;

                    if (currDialog.varname == "varnameSDC")
                    {
                        InlineKeyboardMarkup kb = new InlineKeyboardMarkup(new[]
                        {
                            new InlineKeyboardButton[]
                            {
                                new InlineKeyboardButton("Cloudy", "SDC_Cloudy"),
                                new InlineKeyboardButton("Sun_0", "SDC_Sun_0"),
                                new InlineKeyboardButton("Sun_1", "SDC_Sun_1"),
                                new InlineKeyboardButton("Sun_2", "SDC_Sun_2"),
                            },
                            new InlineKeyboardButton[]
                            {
                                new InlineKeyboardButton("Defect", "SDC_Defect"),
                            }
                        });

                        Message sentMsg = await Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, "Please choose value",
                                                                         replyMarkup : kb);

                        currDialog.valueRequestMessage = sentMsg;
                        return;
                    }
                    else if (currDialog.varname == "varnameTCC")
                    {
                        InlineKeyboardMarkup kb = new InlineKeyboardMarkup(new[]
                        {
                            new InlineKeyboardButton[]
                            {
                                new InlineKeyboardButton("0", "TCC_value_0"),
                                new InlineKeyboardButton("1", "TCC_value_1"),
                                new InlineKeyboardButton("2", "TCC_value_2"),
                                new InlineKeyboardButton("3", "TCC_value_3"),
                            },
                            new InlineKeyboardButton[]
                            {
                                new InlineKeyboardButton("4", "TCC_value_4"),
                                new InlineKeyboardButton("5", "TCC_value_5"),
                                new InlineKeyboardButton("6", "TCC_value_6"),
                                new InlineKeyboardButton("7", "TCC_value_7"),
                            },
                            new InlineKeyboardButton[]
                            {
                                new InlineKeyboardButton("8", "TCC_value_8"),
                                new InlineKeyboardButton("Defect", "TCC_Defect"),
                            }
                        });

                        Message sentMsg = await Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, "Please choose value",
                                                                         replyMarkup : kb);

                        currDialog.valueRequestMessage = sentMsg;
                        return;
                    }
                    return;
                }
                else
                {
                    string replMessage = "Извините, меня еще не научили разбирать такие сложные команды.";
                    await Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, replMessage, true, false, currQuery.Message.MessageId, BasicKeyboard());

                    return;
                }
            }
            else
            {
                if (currDialog.varname == "varnameSDC")
                {
                    currDialog.varvalue = currQuery.Data;


                    string replMessage =
                        "Благодарим Вас за участие в обучении нашей модели (SDC). Ваше исправление отправлено на ревизию и будет учтено при дообучении.";

                    await
                    Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, replMessage, true, false,
                                             currQuery.Message.MessageId, BasicKeyboard());

                    ServiceTools.WriteObjectToXML(currDialog, Directory.GetCurrentDirectory() +
                                                  Path.DirectorySeparatorChar + "logs" +
                                                  Path.DirectorySeparatorChar +
                                                  "model_fix_" + currDialog.varname + "_" + currDialog.varChoosingMessage.MessageId +
                                                  ".xml");

                    lDialogs.Remove(currDialog);

                    return;
                }
                else if (currDialog.varname == "varnameTCC")
                {
                    currDialog.varvalue = currQuery.Data;


                    string replMessage =
                        "Благодарим Вас за участие в обучении нашей модели (TCC). Ваше исправление отправлено на ревизию и будет учтено при дообучении.";

                    await
                    Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, replMessage, true, false,
                                             currQuery.Message.MessageId, BasicKeyboard());

                    ServiceTools.WriteObjectToXML(currDialog, Directory.GetCurrentDirectory() +
                                                  Path.DirectorySeparatorChar + "logs" +
                                                  Path.DirectorySeparatorChar +
                                                  "model_fix_" + currDialog.varname + "_" + currDialog.varChoosingMessage.MessageId +
                                                  ".xml");

                    lDialogs.Remove(currDialog);

                    return;
                }
                else
                {
                    string replMessage = "Извините, меня еще не научили разбирать такие сложные команды.";
                    await Bot.SendTextMessageAsync(currQuery.Message.Chat.Id, replMessage, true, false, currQuery.Message.MessageId, BasicKeyboard());

                    return;
                }
            }
        }