diff --git a/TelegramBotBase/Form/WebAppButtonBase.cs b/TelegramBotBase/Form/WebAppButtonBase.cs new file mode 100644 index 0000000..7bd0de1 --- /dev/null +++ b/TelegramBotBase/Form/WebAppButtonBase.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Telegram.Bot.Types; +using Telegram.Bot.Types.ReplyMarkups; + +namespace TelegramBotBase.Form +{ + public class WebAppButtonBase : ButtonBase + { + public WebAppInfo WebAppInfo { get; set; } + + public WebAppButtonBase() + { + + } + + public WebAppButtonBase(String Text, WebAppInfo WebAppInfo) + { + this.Text = Text; + this.WebAppInfo = WebAppInfo; + } + + /// + /// Returns an inline Button + /// + /// + /// + public override InlineKeyboardButton ToInlineButton(ButtonForm form) + { + return InlineKeyboardButton.WithWebApp(this.Text, this.WebAppInfo); + } + + + /// + /// Returns a KeyBoardButton + /// + /// + /// + public override KeyboardButton ToKeyboardButton(ButtonForm form) + { + return KeyboardButton.WithWebApp(this.Text, this.WebAppInfo); + } + + } +}