using System; using System.Data.SqlClient; using SvetoforVKBot.Models.Updates; using VkNet; using VkNet.Enums.SafetyEnums; using VkNet.Model.Keyboard; using VkNet.Model.RequestParams; namespace SvetoforVKBot.Models.Commands.LK.Calculators { public class SelectCalculatorCcalCommand : Command { public override string Name => "{\"button\":\"selectCalculatorCcal\"}"; public override void Execute(RootObject update, VkApi client, SvetoforVKBot.Data.SvetoforVKBotEntities db) { } public override void ExecutePL(RootObject update, VkApi client, SvetoforVKBot.Data.SvetoforVKBotEntities db) { var chatId = update.@object.message.from_id; MessagesSendParams @params = new MessagesSendParams(); var keyboardBuilder = new KeyboardBuilder().Clear(); try { @params.Message = "🚦Выберите на клавиатуре комфортный для Вас режим сохранения/потери веса.\n"; keyboardBuilder .AddButton("🟥Не изменяя вес", "selectCalcCcalResult-1", KeyboardButtonColor.Primary) //К .AddLine() .AddButton("🟨Снижение веса", "selectCalcCcalResult-2", KeyboardButtonColor.Primary) //Ж .AddLine() .AddButton("🟩Быстрое снижение веса", "selectCalcCcalResult-3", KeyboardButtonColor.Primary) //З .AddLine() .AddButton("Назад", "startPL", KeyboardButtonColor.Default); @params.Keyboard = keyboardBuilder.Build(); @params.UserId = chatId; @params.RandomId = GetRandomId(); client.Messages.SendAsync(@params); } catch (Exception ee) { @params.Message = "Ошибка в SelectCalculatorCcalCommand: " + ee.Message; @params.Attachments = null; @params.Keyboard = null; @params.UserId = 59111081; @params.RandomId = GetRandomId(); client.Messages.SendAsync(@params); } } } }