Ejemplo n.º 1
0
        public override NameValueCollection BuildParameters()
        {
            if (Document == null || string.IsNullOrWhiteSpace(Document.FileId))
            {
                throw new FileIdNotFoundException();
            }

            var result = new NameValueCollection
            {
                { "chatId", ChatId },
                { "fileId", Document.FileId }
            };

            if (!string.IsNullOrWhiteSpace(Caption))
            {
                result.Add("caption", Caption);
            }

            if (ReplyMarkup != null)
            {
                string markup = ReplyMarkup.ToJson();
                result.Add("inlineKeyboardMarkup", markup);
            }

            return(result);
        }
Ejemplo n.º 2
0
        public override NameValueCollection BuildParameters()
        {
            var result = new NameValueCollection
            {
                { "chatId", ChatId },
            };

            if (!string.IsNullOrWhiteSpace(Caption))
            {
                result.Add("caption", Caption);
            }

            if (ReplyMarkup != null)
            {
                string markup = ReplyMarkup.ToJson();
                result.Add("inlineKeyboardMarkup", markup);
            }

            return(result);
        }