diff --git a/TelegramBotBase/Form/ButtonForm.cs b/TelegramBotBase/Form/ButtonForm.cs index 8f99423..8346c8c 100644 --- a/TelegramBotBase/Form/ButtonForm.cs +++ b/TelegramBotBase/Form/ButtonForm.cs @@ -124,6 +124,16 @@ namespace TelegramBotBase.Form return ikb; } + /// + /// Returns the first Button with the given value. + /// + /// + /// + public ButtonBase GetButtonByValue(String value) + { + return this.ToList().Where(a => a.Value == value).FirstOrDefault(); + } + public static implicit operator InlineKeyboardMarkup(ButtonForm form) { if (form == null)