- adding GetButtonByValue to ButtonForm

This commit is contained in:
FlorianDahn 2020-03-27 11:03:15 +07:00
parent 37ef30ebee
commit 321bd7c0ff

View File

@ -124,6 +124,16 @@ namespace TelegramBotBase.Form
return ikb;
}
/// <summary>
/// Returns the first Button with the given value.
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public ButtonBase GetButtonByValue(String value)
{
return this.ToList().Where(a => a.Value == value).FirstOrDefault();
}
public static implicit operator InlineKeyboardMarkup(ButtonForm form)
{
if (form == null)