コード例 #1
0
        public InlineKeyboardBuilder AddButton(string text)
        {
            InlineKeyboardItem item = InlineKeyboardItem.Simple(text, text, null);

            rowItems.Add(item);

            return(this);
        }
コード例 #2
0
        public InlineKeyboardBuilder AddButton(string text, string callbackData, string description = null)
        {
            InlineKeyboardItem item = InlineKeyboardItem.Simple(text, callbackData, description);

            rowItems.Add(item);

            return(this);
        }
コード例 #3
0
        public void Inline_keyboard_serialization_must_be_equal_to_expected()
        {
            InlineKeyboard inlineKeyboard = new InlineKeyboard();

            inlineKeyboard.AddRow(new List <InlineKeyboardItem>()
            {
                InlineKeyboardItem.Simple("simple button", "btnSmpTapped"),
                InlineKeyboardItem.Payment("payment", 5000, "GUID/refId", "give me that.."),
                InlineKeyboardItem.OpenUrl("bing", "https://bing.com")
            });

            string result   = Utils.Serialize(inlineKeyboard).Replace(" ", "").ToLower();
            string expected = Utils.ReadFile(JsonsDirectory + "text\\inlineKeyboard.txt").Replace("\n", "").Replace("\r", "").Replace(" ", "").ToLower();

            result.Should().Be(expected);
        }